Re: An interesting case

2021-06-07 Thread Baris Kazar
my worry is actually about the lucene's performance. if lucene collects thousands of hits instead of actually n (<<< a couple of 1000s) hits, then this creates performance issue. ScoreDoc array is ok as i mentioned ie, it has size n. i will check count api. Best regards

Re: An interesting case

2021-06-07 Thread Adrien Grand
When you call IndexSearcher#search(Query query, int n), there are two cases: - either your query matches n hits or more, and the TopDocs object will have a ScoreDoc[] array that contains the n best scoring hits sorted by descending score, - or your query matches less then n hits and then the TopD

Re: An interesting case

2021-06-07 Thread baris . kazar
https://stackoverflow.com/questions/50368313/relation-between-topdocs-totalhits-and-parameter-n-of-indexsearcher-search looks like someone else also had this problem, too. Any suggestions please? Best regards On 6/8/21 1:36 AM, baris.ka...@oracle.com wrote: Hi,-  I use IndexSearcher.search

An interesting case

2021-06-07 Thread baris . kazar
Hi,-  I use IndexSearcher.search API with two parameters like Query and int number (i set as 20). However, when i look at the TopDocs object which is the result of this above API call i see thousands of hits from totalhits. Is this inaccurate or Lucene is doing actually search based on tha

RE: Changing Term Vectors for Query

2021-06-07 Thread Marcel D.
Hi, at first i think i missed pointing out my problem exactly. What i wanna do is run a normal query on my index. After that i wanna change the frequencies of some important terms to another number and i know neither the new frequency nor the term which frequency i update at index creation. As f

RE: Changing Term Vectors for Query

2021-06-07 Thread Uwe Schindler
Hi, the only way to get this performance wise effective would be the approach by Adrien. What you generally do is to index the same information into 2 different fields (in Solr or Elasticsearch as "copy_to / copyfield") with different analyzers. During query you choosse the field applicable.

Re: Changing Term Vectors for Query

2021-06-07 Thread Marcel D.
Hi Adrien, i forgot to mention that i also need the original frequencies. I have some queries i need to perform with the original frequencies and then some with custom frequencies, but as im only having a small index and a few queries that would work, but a solution where i dont have to change t

Re: Changing Term Vectors for Query

2021-06-07 Thread Adrien Grand
Hi Marcel, You can make Lucene index custom frequencies using something like DelimitedTermFrequencyTokenFilter , which would be easier than writing a custom Query/