Re: Filter and FilteredQuery replacements

2022-07-11 Thread Mikhail Khludnev
Hello, Scott. I've found such straightforward implementation https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java#L512 and a more space efficient one https://github.com/apache/lucene/blob/d6dbe4374a5229b827613b85066f3a4da91d5f27/lucene/core/sr

Filter and FilteredQuery replacements

2022-07-11 Thread Scotter
Hi there, Hopefully this is the right audience for my question. I'm a developer working on an effort to upgrade our Java app from Lucene 5 to Lucene 8 (or later). While doing investigation into changes in these versions the main thing that I'm struggling with is how to replace our current usage of

Re: Fuzzy Query Similarity

2022-07-11 Thread Mike Drob
Hi Uwe, thanks for all the pointers! I tried using BooleanSimilarity and the resulting scores were even more divergent! 1.0 for the exact match vs 1.55 (= 0.8 + 0.75) for the multiple terms that were close. Which makes sense with ignoring TF but still doesn't help me down-boost the other terms.

Re: Lucene Disable scoring

2022-07-11 Thread Adrien Grand
Note that Lucene automatically disables scoring already when scores are not needed. E.g. queries that compute the top-k hits by score will definitely compute scores, but if you are just counting the number of matches of a query or aggregations, then Lucene skips scoring entirely already. Is there

Re: Lucene Disable scoring

2022-07-11 Thread Mikhail Khludnev
I'd rather agree with Uwe, but you can plug BooleanSimilarity just to check it out. On Mon, Jul 11, 2022 at 6:01 PM Mohammad Kasaei wrote: > Hello > > I have a question. Is it possible to completely disable scoring in lucene? > > Detailed description: > I have an index in elasticsearch and it co

Re: Lucene Disable scoring

2022-07-11 Thread Uwe Schindler
No that's the only way to do it. The function call does not cost overheads because it is optimized away by the runtime. Uwe Am 10.07.2022 um 11:34 schrieb Mohammad Kasaei: Hello I have a question. Is it possible to completely disable scoring in lucene? Detailed description: I have an index i

Lucene Disable scoring

2022-07-11 Thread Mohammad Kasaei
Hello I have a question. Is it possible to completely disable scoring in lucene? Detailed description: I have an index in elasticsearch and it contains big shards (every shard about 500m docs) so a nano second of time spent on scoring every document in any shard causes a few second delay in the q

Re: Lucene's LRU Query Cache - Deep Dive

2022-07-11 Thread Adrien Grand
Hey Shradha, This correctly describes the what, but I think it could add more color about why the cache behaves this way to be more useful, e.g. - Why doesn't the cache cache all queries? Lucene is relatively good at evaluating a subset of the matching documents, e.g. queries sorted by numeric fi