apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.45k stars 975 forks source link

Add timeout support to AbstractVectorSimilarityQuery #13285

Open kaivalnp opened 2 months ago

kaivalnp commented 2 months ago

Description

Along similar lines of #13202, adding timeout support for AbstractVectorSimilarityQuery which performs similarity-based vector searches

While the graph search happens inside #scorer, it may go over the configured QueryTimeout and we can early terminate it to return whatever partial results are found..

One inherent benefit we have for exact search is that we return a lazy-loading iterator over all vectors, so this is inherently covered by the TimeLimitingBulkScorer (as opposed to exact search of AbstractKnnVectorQuery which manually goes over all vectors to retain the topK during #rewrite)

github-actions[bot] commented 2 months ago

This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution!

benwtrent commented 2 months ago

This seems sane to me.

@vigyasharma what do you think?

benwtrent commented 2 months ago

@kaivalnp could you update CHANGES as well?

kaivalnp commented 2 months ago

Thanks @benwtrent! Added an entry now..

kaivalnp commented 1 month ago

Saw some merge conflicts after a recent commit and resolved those..

kaivalnp commented 1 month ago

Hi @benwtrent @vigyasharma could you help review this? Thanks!

github-actions[bot] commented 1 month ago

This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution!

kaivalnp commented 2 weeks ago

Summary of latest changes:

  1. Resolved merge conflicts
  2. Moved CHANGES.txt entry from 9.11 -> 9.12 since the prior is now released
  3. #Scorer is now final and not overrideable, changed VectorSimilarityScorer -> VectorSimilarityScorerSupplier
github-actions[bot] commented 5 days ago

This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution!