api icon indicating copy to clipboard operation
api copied to clipboard

`ignored` property of Search API

Open tomcrane opened this issue 2 years ago • 2 comments

These changes would be a breaking change for v3 of Search, but they allows for static implementations

A Server MUST state that it has ignored parameters defined in the Search spec, but only SHOULD state that it has ignored other parameters.

e.g., MUST ?user=xxx => "ignored": ["user"] ?user=xxx&color=blue => "ignored": ["user"]

SHOULD ?user=xxx&color=blue => "ignored": ["user", "color"]

A Server MAY state that it has ignored parameters defined in this specification, even if they were not supplied

(no query string at all...!) GET /search/my-video-transcripts/en => "ignored": ["q", "user", "date", "motivation"]

This could be served statically, and doesn't have to dynamically generate ignored for spec or any other parameters.

In the current spec this doesn't make much sense but it opens the way for static sets of search results to supply captions as discussed in https://github.com/IIIF/api/issues/762#issuecomment-368821512, or potentially authed search services.

tomcrane avatar Jun 10 '22 15:06 tomcrane

Should this be included in Search 3.0? (thumbs up/down on the comment please)

azaroth42 avatar Jun 28 '22 16:06 azaroth42

I think this is a good addition for fully-static search, but I think there are a few more things that would make it more viable for larger sets of search results - without huge result pages.

In addition to "ignored": ["user", "date", "motivation"], a service could supply an optional template:

{
  "template": "https://example.github.io/static/results/{q}-results/{page}.json"
}

To be effective, you would likely need a way to limit the values of q - perhaps by using a behavior on an Autocomplete. So an autocomplete could return:

  • "Factories"
  • "Farms"
  • "Residential"

Which would be the only valid options for q in the search. That would fully close the loop for static and archivable search results. Which could be served as:

https://example.github.io/static/autocomplete.json
https://example.github.io/static/results/all.json <-- Fall back for clients ignoring the "template"
https://example.github.io/static/results/Factories-results/1.json
https://example.github.io/static/results/Farms-results/1.json
https://example.github.io/static/results/Residential-results/1.json
https://example.github.io/static/results/Residential-results/2.json

The naming/method might be incorrect, but I think the goal of being able to generate a finite set of search results would be very useful.

stephenwf avatar Oct 24 '22 11:10 stephenwf