Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can/how can we support search through the API #36

Open
jackdos opened this issue Nov 3, 2021 · 4 comments
Open

Can/how can we support search through the API #36

jackdos opened this issue Nov 3, 2021 · 4 comments
Assignees
Labels
question Further information is requested
Milestone

Comments

@jackdos
Copy link
Collaborator

jackdos commented Nov 3, 2021

As a UI developer, I want to be able to provide search functionality for my PAR backend, for example, "find 'Microsoft Word' file formats".

Is there a standard search syntax we can add to the API?

Does the search need to be entity specific? i.e. do you search the whole endpoint for "Document" or just file-formats?

Would we need to mandate what fields are included in the search? i.e. if you search "word" under file-formats does that mean "name contains" or "name or description contains" or "any field contains"?

Would we need to mandate that any search like this had to be 'fielded', (/file-formats/search?format.name='Microsoft Word')?

@jackdos jackdos added the question Further information is requested label Nov 3, 2021
@jhsimpson jhsimpson added this to the v1.3.0 milestone Mar 1, 2023
@jhsimpson
Copy link
Collaborator

The main focus of the 1.3.0 release will be to resolve this issue.

@jhsimpson
Copy link
Collaborator

Proposal

Ordering
add a query parameter called 'ordering' to each api call. For each entity, the api spec should provide a list of the allowed values, which should include at least one field name from that entity. When a client sends a get request that includes ordering=foo, then the results returned by the server will be ordered by the field named foo in ascending order. To sort in descending order, the field name is specified as ordering=d-foo.

Searching
add a new api endpoint /search. This takes two query parameters:

  1. type - can be one of the supported schemas (business-rule, preservation-action, preservation-action-type,file-format,file-format-category,tool)
  2. q - includes the users query, written as a list of field filters. Each api endpoint will need to describe which fields can be used, and whether they support ranges, or greater than/less than, or wild card text searches, etc E.g., see spotify search api https://developer.spotify.com/documentation/web-api/reference/search

@jhsimpson
Copy link
Collaborator

a rough first version for discussion
https://github.com/openpreserve/par/tree/feat/add-search

jhsimpson added a commit that referenced this issue May 1, 2024
Adds  a new query parameter 'ordering' to the /tools GET request.
Defines 3 properties that this request can be ordered by.

related to #36
jhsimpson pushed a commit that referenced this issue Sep 4, 2024
Add a new `orderNameLastModDateParam` to support a standard way of ordering most get requests.
Addresses the first half of #36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants