Azure-search: How to get documents which exectly contain search term -
this question/answer dealt pretty similar topic, couldn´t find solution searching for. how practially use keywordanalyzer in azure-search?
starting situation:
i created resource multiple indexes. 1 of these indexes contains collection(edm.string) field. field want documents exectly contain search term. example field contains documetns these: "hovercraft zero", "hovercraft one", "hovercraft two". if search term "hover" 3 documents should returned. if search term "craft zer" document "hovercraft zero" should returned. document shouldn´t higher score, desired behaviour "hovercraft zero" document result.
further information:
it not possible set searchmode (like recomended in question on top) because want set behaviour specific field , not searchqueries. not possible let responsibility on user enter search term quotes.
what tried far:
- use keyword analyzer described in question on top: no success
- use indexanalyzer specific token filters (ngram, lowercase) , searchanalyzer keyword analyzer: no success
- use charfilters manipulate search term , manually set quotes on first , last position (craft zer -> "craft zer"). yahnoosh explained in question on top, query parser processes query string before analyzers applied. so: no success
is there solution issue? or there other approach achieve desired behaviour?
hopefully can help.
thanks in advance!
using example 3 documents: "hovercraft zero", "hovercraft one", "hovercraft two"
issue prefix query find documents contain terms start "hover"
search=hover*
to match term "craft zer", need use keyword analyzer (or keyword tokenizer lowercase token filter) @ indexing time make sure elements of string collection not tokenized. @ query time can issue regex query (note regex queries slower term or prefix queries)
search=/.craft zer./&querytype=full
also, please use analyze api test custom analyzer configurations. make sure analyzer produces terms expect.
Comments
Post a Comment