After I just had an issue with a capitalised uri not returning any results from an annotation search (using a non-default mapping), @tilgovi suggested to use 'match' instead of 'term' filters in queries. Would this be an improvement, and would it provide a solution to #73 and #75 as well?
As explained on stackoverflow:
The match query will apply the same standard analyzer to the search term and will therefore match what is stored in the index. The term query does not apply any analyzers to the search term, so will only look for that exact term in the index.
A related question is: What is the desired behaviour of the search? For a URI, userid and such an exact match seems appropriate, while perhaps for the text field fuzzy matching could be acceptable? I suppose that these things could be controlled in the mapping.
For reference, right now the main part of queries is built like this: (in elasticsearch.py)
for k, v in query.iteritems():
q['filtered']['filter']['and'].append({'term': {k: v}})
After I just had an issue with a capitalised uri not returning any results from an annotation search (using a non-default mapping), @tilgovi suggested to use 'match' instead of 'term' filters in queries. Would this be an improvement, and would it provide a solution to #73 and #75 as well?
As explained on stackoverflow:
A related question is: What is the desired behaviour of the search? For a URI, userid and such an exact match seems appropriate, while perhaps for the text field fuzzy matching could be acceptable? I suppose that these things could be controlled in the mapping.
For reference, right now the main part of queries is built like this: (in elasticsearch.py)