Closed piemon-nyah closed 1 month ago
After using profile, I found that term condition and multi_match are independent queries. Even if there is data in df33, it will not match because max_expansions is only 50 by default. Is there a way to prioritize the term condition and then match match_phrase_prefix to ensure that I get the result I want?
Pinging @elastic/es-search-relevance (Team:Search Relevance)
Hi @piemon-nyah !
Even if there is data in df33, it will not match because max_expansions is only 50 by default.
That seems to be the reason why there's no data coming back. I don't think this is a bug so I'm closing this issue. In case you need more support you can check in our forums.
May I suggest to use a different analyzer for performing this search? You could use multifields for having a search-as-you-type multifield for filtering purposes?
@carlosdelest i know it will not match because max_expansions is only 50 by default. Is there a way to prioritize the term condition and then match match_phrase_prefix to ensure that I get the result I want?
Hi @piemon-nyah ! I don't think there's any. Filters are not applied sequentially, and terms expansion will work independently of the other filters applied.
I believe using a different analyzer / different field for filtering purposes should be the way to go here.
@carlosdelest okay,thank you
Elasticsearch Version
7.17.3
Installed Plugins
No response
Java Version
bundled
OS Version
AnolisOS Linux 7.9
Problem Description
I used word_delimiter_graph to handle the word segmentation problem of letters and numbers. But when I use match_phrase_prefix to search for a combination of letters and numbers such as df337, I can't find the results I want.
For example, when I insert a data containing DF33760BF_X4, I can find the data using df and df337, but not df33.
This problem does not occur when the index data size is small(single index has 3 million records,1.5GB). However, this problem occurs when the data size is large(single index has 30 million records,15GB ).
Steps to Reproduce
index setting
demo-data
search-dsl
both df or df337 can find data df33 can't find data
Logs (if relevant)
I used analyze to confirm the token, df and 33760 are correct tokens
analyze result
I also tried setting preserve_original=true, adjust_offsets=false. I also tried customizing the char_filter to separate alphabet and numbers
But the result is the same, I can't search out the data through df33