a little relating and continuing to this question: Azure Search Analyzer
I want to use a keywordanalyzer for word collections.
We have documents (products) with different fields like product_name, brand, categorie and so on.
To implement a keyword based ranking (scoring) I would like to add a Collection(Edm.String) field which contains different (untokenized!!) keywords, like: "brown teddy" or "green bean".
To achieve this I thought about using a keywordanalyzer with the following definition:
// field definition:
{
"name": "keyWordList",
"type": "Collection(Edm.String)",
"analyzer": "keywordAnalyzer"
}
...
"analyzers": [ {
"name":"keywordAnalyzer",
"@odata.type":"#Microsoft.Azure.Search.CustomAnalyzer",
"tokenizer":"keywordTokenizer",
"tokenFilters":[ "lowercase", "classic" ]
} ]
...
"tokenizers": [{
"name": "keywordTokenizer",
"@odata.type": "#Microsoft.Azure.Search.KeywordTokenizer"
}
Now after having uploaded some documents, I just can't find the fields by entering exactly the chosen keywords.
For example the is a document with the following field-data:
"keyWordList": [ "Blue Bear", "blue bear", "blue bear123" ]
Im not able to find any result by querying the following search:
{ search:"blue bear", count:"true", queryType:"full" }
Here is what I tried as well:
- using the predefined keywordanalyzer instead of a customized one -> no success
- instead of using Collection(Edm.String) I just tested it with a normal String field, containing only one keyword -> no success
- splitting up the analyzer in the field definition-block into searchAnalyzer="lowercaseAnalyzer" and filterAnalyzer="keywordAnalyzer" vice versa -> no success
In the end the only result I could get was via sending the whole seach phase as a single term. But this should be done by the analyzer, right?!
{ search:"\"blue bear\"", count:"true", queryType:"full" }
Users don't know if they search for an existing keyword or perform a tokenized search. That's why this won't be an option.
Is there any solution to this issue of mine? Or is there maybe a better / easier approach for this kind of keyword (high scoring) seach?
Thanks!