Elasticsearch: Fuziness ignored when multi_match query type is set to cross_fields.

Created on 15 Jul 2014  Â·  40Comments  Â·  Source: elastic/elasticsearch

Is there any reason for this behavior ?
It can be very usefull to use fuziness on cross_fields multi_match queries.

discuss

Most helpful comment

Hi @clintongormley,

One of the shortcoming of the method you propose is that it seems impossible to have weighted fields with copy_to. The other one is the need to reindex all when you want to change the fields used into the query.

I propose the issue stays open because the cross_fields fuzziness is an important feature IMHO.

From what I experienced during my tests, the problem seems to be into blended() which does not support the Lucene fuzziness operator :

The query string I have used fro my test :

blended("bath", field: [name_fr, description_fr])             <-- works
blended("bath~0.2", field: [name_fr, description_fr])       <-- does not works

Am I right ?
If so, is this a ES patch or a Lucene problem (I can find where blended is implemented yet)

All 40 comments

Hi @afoucret

Yes, fuzziness really complicates the logic with the blended term query that cross_fields uses internally, and has a significant performance impact. Currently we have no plans to add support for fuzziness to cross_fields.

Really sad to heard this.

Did you have an alternative or some magic tricks to obtains some this kind of feature ?

You can use copy_to to make a custom _all field and then the query becomes a simple match query with fuzziness

Hi @clintongormley,

One of the shortcoming of the method you propose is that it seems impossible to have weighted fields with copy_to. The other one is the need to reindex all when you want to change the fields used into the query.

I propose the issue stays open because the cross_fields fuzziness is an important feature IMHO.

From what I experienced during my tests, the problem seems to be into blended() which does not support the Lucene fuzziness operator :

The query string I have used fro my test :

blended("bath", field: [name_fr, description_fr])             <-- works
blended("bath~0.2", field: [name_fr, description_fr])       <-- does not works

Am I right ?
If so, is this a ES patch or a Lucene problem (I can find where blended is implemented yet)

I have a query with should with function_score with fuzziness 0.75 with multi_match with cross_field
My query is a term without one last character - for instance "NAM" instead of "NAME"
By fuzziness rules it must be returned to me , but I don't get results.
What would you suggest on this matter?

What about throw a QueryParsingException error? I lost 2 hours before arriving on this issue ;-(

Thanks

+1, would be really handy

+1

+1 I need this :)

Best_fields worked for me
On Jun 16, 2015 9:30 PM, "Clinton J. Pitzak" [email protected]
wrote:

+1 I need this :)

—
Reply to this email directly or view it on GitHub
https://github.com/elastic/elasticsearch/issues/6866#issuecomment-112522104
.

:+1:

:+1:

+1

Would love to see fuzziness support for cross_field queries for the same reason afoucret mentioned earlier in this thread.

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1 for the same reasons afoucret explained.

My workaround right now is to add another match query and wrap the two in a bool.should clause. This new match query would only match the field i wish to boost with an and operator. This means that if the input is only terms from the boosted field, it will score above all fields which matched via the _all field.
However, if I add more terms so that the boosted field no longer matches all those terms, all fields will be weighted equally.
This solution is good enough for me.

Was this page helpful?
0 / 5 - 0 ratings