Hi all,
I am trying to filter with a string value of ‘snippet name a’. Following the instructions of DS on filtering substrings that include whitespaces, I have added the annotation enable_approximate_match_search for Snippet.SnippetName field and my filter criteria look like this:
{
"filters":[
"~Snippet.SnippetName:snippet",
"~Snippet.SnippetName:name"
"~Snippet.SnippetName:a"
]
}
However, no results were matched despite the existence of the entry. But when using a string value of ‘snippet name’, it returned as expected. It seems that my filter value cannot consist of a single character, as no results will be matched in this case. Is it a known bug or am I missing any configuration?
Hi,
Could you please check if
mgmtp.a12.dataservices.search.analysis.fullText.ngrams.enabled=true
Hi @quynh-still-birch , this is not a bug. To achieve approximate search we have to enable ngrams on FullText search as @loi-risen-dale said, and by default our solr configuration for this is
this means the minimum number of characters to be broken down for indexing an approximate search field is 2(minGramSize), E.g: abc → ab, bc . If you search for approximate “ab” or “bc” the query returns correct result but if searching for “a” there is no result. You can overwrite this configuration to make the search return expected result, but this will cost a lot of performance and memory space for the search engine, this is why we set it to 2. Please consider about this and feed free to contact me directly if you need more explanation.
Thanks.