Permalink
Please sign in to comment.
Browse files
Query tags field with a match query (use mapping analyzer)
The "tags" field is stored in Elasticsearch analysed (by our custom
"uni_normalizer" analyzer). This means, broadly, that in the inverted
index, individual terms in a tag will be stripped of punctuation and
case-normalised. As such, we need to do the same normalisation when
querying, and the easiest way to do this is with a match query.
This commit changes "tag" queries so that:
- all tag parameters must match
- multiple tokens within one tag query are all required to match
By way of example, for an annotation with tags:
["hello", "#THERE", "big world"]
These queries will match:
tag=hello
tag=HELLO
tag=#hello
tag=hello&tag=there
tag=hello&tag=there&tag=big+world
tag=hello&tag=there&tag=world+big
Whereas these will not:
tag=he+llo
tag=hello&tag=monkeys
tag=hello&tag=world
Fixes #2655.- Loading branch information...
Showing
with
11 additions
and 3 deletions.
- +3 −1 h/api/search/query.py
- +8 −2 h/api/search/test/query_test.py
0 comments on commit
9a655a0