Multimatch not working as expected, help needed


(Laura Cabre) #1

Hi!

I am wondering why I am seeing the following (Elasticsearch V 5.1)

I have the following query.

{
"multi_match" : {
"query" : "bli",
"type" : "phrase_prefix",
"fields" : [ "TITLE", "DESCR50", "NAMEFORMAL" ]
}
}

I am able to find a document that contains "NAMEFORMAL" = "Marcus Bliss" , but a document with a "DESCR50" = "Public Work" is not returned. I have confirmed that such document exists and it can be found through other criteria. When creating the index, I did not specify any properties for such fields... so I would assume the would behave similarly... Any help with this would me much appreciated. Thanks!


(Mark Harwood) #2

"bli" is a prefix of "bliss" but not of "public".

If you want in-word matching of this kind I suggest you look at ngram indexing - see https://www.elastic.co/guide/en/elasticsearch/guide/current/_ngrams_for_partial_matching.html

This would mean the index doesn't just contain the word "public" but also word fragments ubli, blic, lic etc


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.