We're updating the issue view to help you get more done. 

.withPrefixLength is ignored for .keyword().fuzzy() queries in the Elasticsearch integration

Description

The bug is located in org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsTermQueryBuilder#createRemoteQuery:

1 2 3 4 5 6 if ( termContext.getApproximation() == TermQueryContext.Approximation.FUZZY ) { // TODO: remove the threshold method as it's deprecated and not accurate // the max edit distance based on the total searchTerm length which is wrong // It might be a good time to consider removing the deprecated threshold method queryBuilder.maxEditDistance( getMaxEditDistance( searchTerm ) ); }

We forgot to get and set the prefix length in this block.

Only Hibernate Search 5.x is affected.

Environment

None

Status

Assignee

Fabio Massimo Ercoli

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Affects versions

5.11.1.Final
5.10.5.Final

Priority

Major