Skip to content

[BUG] Correct EF_Search parameter is not passed for Lucene Engine when ef_search not set in method_parameters #2940

@navneet1v

Description

@navneet1v

Description

For Lucene engine we use Lucene library to do the K-NN search. Lucene library doesn't take ef_search as a parameter and only takes k as a parameter. Due to this in k-NN query when ef_search is not passed as method parameters we just pass k which acts as ef_search and may lead to drop in recall and also less number of results. Ref: #2881

Solution

Ideally we should update the logic for Lucene engine and start doing this:

  1. If ef_search is not passed in method parameters then

    1. Check if ef_search is set in index_mappings if not then use default ef_search based in index version else return the ef_search set on the index mappings
  2. ef_search = max(k, ef_search)

  3. Once Lucene query is completed reduce the number of results to final topK results.

This will ensure that we are always passing right value of ef_search parameter for Lucene engine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    3.x

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions