Skip to content

Commit

Permalink
Add documentation about filters
Browse files Browse the repository at this point in the history
Signed-off-by: Olga Bulat <[email protected]>
  • Loading branch information
obulat committed Oct 30, 2023
1 parent 15952fc commit e95364e
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions documentation/api/reference/search_algorithm.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,12 @@ following fields:

- Extension
- Category
- Length
- Aspect ratio
- Size
- Source
- License
- License type
- Length (audio only)
- Aspect ratio (image only)
- Size (image only)

Source is the only field for which you can currently also specify exclusions.

Expand All @@ -152,12 +153,13 @@ field:
- [Audio search](https://api.openverse.engineering/v1/#operation/audio_search)
- [Image search](https://api.openverse.engineering/v1/#operation/image_search)

Each of these fields are searched relatively strictly, primarily because the
search domain in each is very small and "keyword" like. That is, there is a
limited and specific set of terms that appear for the relevant document fields
for each of these query parameters. All of them are validated to only allow
specific options (documented in the API documentation links above), which
enforces the "keyword" like nature of their usage.
For each of these fields, there is a limited and specific set of terms that
appear for the relevant document fields for each of these query parameters.
These fields are matched exactly, using the filter context Elasticsearch queries
("filter" or "must_not"). Filter-context queries can be cached by Elasticsearch,
which improves their performance. All of these filters except for `extension`
are validated to only allow specific options (documented in the API
documentation links above).

### General "query" searching

Expand Down

0 comments on commit e95364e

Please sign in to comment.