apache / apache/lucene

Turning LRUQueryCache On selectively for only a few query classes [LUCENE-10276]

Open
#11,312 4 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Minor type:task
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Hi,

I'm part of the Amazon Lucene team. I was trying to get KNN queries to work with LRUQueryCache. From my understanding, if I have isCacheable to return true from my query class then it will taken care of. However, I want Lucene to only turn on the cache for KNN only and not for any other query like TermQuery, etc which might also be returning true for the isCacheable method. Is there any easy interface which would allow me to do this without having to go into each individual query class and returning false for the isCacheable  for all of them or having to write my own cache class. Any help would be appreciated.

Please correct me if I have incorrectly assumed something. This is my first issue!

 

Thanks,

Angadpreet Nagpal

---
Migrated from [LUCENE-10276](https://issues.apache.org/jira/browse/LUCENE-10276) by Angadpreet Nagpal, updated Dec 06 2021

Contributor guide

Open the contributing guide

Research direction

Start by reviewing LRUQueryCache and the isCacheable behavior described in the issue; no specific files, tests, or entry points are named. Define how callers could enable caching for KNN queries while excluding other cacheable query classes, and consider how completion would be verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.