Re: Need help on defining custom scorer in Lucene 9

2022-04-03 Thread Michael Wechner
Hi Lokesh IIUC each document (like for example a shop description) has a longitude and a latitude associated with. The user search input are some keywords and the the user's geo location. The keywords you use to search for the documents and the users's geo location you would like to use for

Need help on defining custom scorer in Lucene 9

2022-04-03 Thread Lokesh Mavale
Hi Team, I am little bit familiar with Lucene, and I have a problem statement in hand to score each document based on the value of the field. Value will be of type GeoPoint { Lat Long } And in the qry I will be getting other pair of lat, long and distance from that lat long. I have figured out

RE: Lucene 7.x custom Scorer on point values

2017-10-12 Thread Uwe Schindler
> -Original Message- > From: Dominik Safaric [mailto:dominiksafa...@gmail.com] > Sent: Thursday, October 12, 2017 8:53 AM > To: java-user@lucene.apache.org > Subject: Re: Lucene 7.x custom Scorer on point values > > The number of values per document per field is equal

Re: Lucene 7.x custom Scorer on point values

2017-10-11 Thread Dominik Safaric
.thetaphi.de > eMail: u...@thetaphi.de > > > -Original Message- > > From: Dominik Safaric [mailto:dominiksafa...@gmail.com] > > Sent: Wednesday, October 11, 2017 1:39 PM > > To: java-user@lucene.apache.org > > Subject: Re: Lucene 7.x custom Scorer on po

RE: Lucene 7.x custom Scorer on point values

2017-10-11 Thread Uwe Schindler
hi.de > -Original Message- > From: Dominik Safaric [mailto:dominiksafa...@gmail.com] > Sent: Wednesday, October 11, 2017 1:39 PM > To: java-user@lucene.apache.org > Subject: Re: Lucene 7.x custom Scorer on point values > > Thanks Uwe for the clarification. > > The value

Re: Lucene 7.x custom Scorer on point values

2017-10-11 Thread Dominik Safaric
Thanks Uwe for the clarification. The values are already indexed as numeric docvalues, i.e. numeric point-docvalues. In both cases, either by implementing a custom scorer or function query I would need to access the point values for the matched/hit documents. How can I derive these values given a

RE: Lucene 7.x custom Scorer on point values

2017-10-11 Thread Uwe Schindler
e function queries package. Or much better: I'd use the lucene expressions module to do this. It allows you to express the scoring formula as a javascript formula and use all docvalues fields in your document to calculate the final score. In both cases there is no need to create a custom scorer

Lucene 7.x custom Scorer on point values

2017-10-11 Thread Dominik Safaric
Recently I've implemented a custom Query that in turn scores documents using a custom Scorer implementation using a long primitive point values. The associated field is multi valued and has doc values enabled. For retrieving these multi valued longs I've used LeafReader.document()

Re: Custom Query & reading plongs used by a custom Scorer

2017-10-06 Thread Erick Erickson
g the > custom score I'm retrieving the values of the field using > LeafReader.document(docId()) which is a costly process. What alternatives > are there for reading plongs using a LeafReader and DocIdSetIterator within > a custom Scorer implementation? > > Thanks in adva

Custom Query & reading plongs used by a custom Scorer

2017-10-06 Thread Dominik Safaric
atives are there for reading plongs using a LeafReader and DocIdSetIterator within a custom Scorer implementation? Thanks in advance. Dominik

Re: Use of AllTermDocs with custom scorer

2009-11-17 Thread Peter Keegan
document. Indexes are updated at regular intervals in one jvm. A > > searcher jvm opens the index and reads all the fixed-length records into > > RAM. Given an index-wide docId, the custom scorer can quickly access the > > corresponding fixed-length external data. > > > >

Re: Use of AllTermDocs with custom scorer

2009-11-17 Thread Michael McCandless
AM. Given an index-wide docId, the custom scorer can quickly access the > corresponding fixed-length external data. > > Could you explain a bit more about how mapping the external data to be per > segment would work? As I said, rebuilding the whole file isn't a big deal > and the sing

Re: Use of AllTermDocs with custom scorer

2009-11-17 Thread Michael McCandless
ated for each segment (lights > on!). > So, couldn't I just do the subreader->docBase map lookup once when the > custom scorer is created? No need to access the map for every doc this way. Right, that should work. Mike -

Re: Use of AllTermDocs with custom scorer

2009-11-17 Thread Peter Keegan
ader->docBase map lookup once when the custom scorer is created? No need to access the map for every doc this way. Peter On Tue, Nov 17, 2009 at 8:58 AM, Peter Keegan wrote: > The external data is just an array of fixed-length records, one for each > Lucene document. Indexes are updated a

Re: Use of AllTermDocs with custom scorer

2009-11-17 Thread Peter Keegan
The external data is just an array of fixed-length records, one for each Lucene document. Indexes are updated at regular intervals in one jvm. A searcher jvm opens the index and reads all the fixed-length records into RAM. Given an index-wide docId, the custom scorer can quickly access the

Re: Use of AllTermDocs with custom scorer

2009-11-17 Thread Michael McCandless
...). >>For your custom sort comparator, are you using FieldComparator? > > I'm using the deprecated FieldSortedHitQueue. I started looking into > replacing it with FieldComparator, but it was much more involved than I had > expected, so I postponed. Also, this would only b

Re: Use of AllTermDocs with custom scorer

2009-11-16 Thread Peter Keegan
I postponed. Also, this would only be a partial solution to a query with a custom scorer and custom sorter. >Failing these, Lucene currently visits the readers in index order. >So, you could accumulate the docBase by adding up the reader.maxDoc() >for each reader you've seen. However,

Re: Use of AllTermDocs with custom scorer

2009-11-16 Thread Michael McCandless
Can you remap your external data to be per segment? Presumably hat would make reopens faster for your app. For your custom sort comparator, are you using FieldComparator? If so, Lucene calls setNextReader to tell you the reader & docBase. Failing these, Lucene currently visits the readers in in

Re: Use of AllTermDocs with custom scorer

2009-11-16 Thread Peter Keegan
The same thing is occurring in my custom sort comparator. The ScoreDocs passed to the 'compare' method have docIds that seem to be relative to the segment. Is there any way to translate these into index-wide docIds? Peter On Mon, Nov 16, 2009 at 2:06 PM, Peter Keegan wrote: > I forgot to mention

Re: Use of AllTermDocs with custom scorer

2009-11-16 Thread Peter Keegan
I forgot to mention that this is with V2.9.1 On Mon, Nov 16, 2009 at 1:39 PM, Peter Keegan wrote: > I have a custom query object whose scorer uses the 'AllTermDocs' to get all > non-deleted documents. AllTermDocs returns the docId relative to the > segment, but I need the absolute (index-wide) do

Use of AllTermDocs with custom scorer

2009-11-16 Thread Peter Keegan
I have a custom query object whose scorer uses the 'AllTermDocs' to get all non-deleted documents. AllTermDocs returns the docId relative to the segment, but I need the absolute (index-wide) docId to access external data. What's the best way to get the unique, non-deleted docId? Thanks, Peter

Re: custom scorer

2009-08-20 Thread Simon Willnauer
Chris Salem > > > - Original Message - > To: java-user@lucene.apache.org > From: Grant Ingersoll > Sent: 8/19/2009 7:17:45 PM > Subject: Re: custom scorer > > > Are you setting the Similarity before indexing, too, on the IndexWriter? > > On Aug 19, 2009, at 4:20 PM, Chris

Re: custom scorer

2009-08-20 Thread Chris Salem
No, I take it I have to use it for both? Is there anything else I should have to do? Sincerely, Chris Salem - Original Message - To: java-user@lucene.apache.org From: Grant Ingersoll Sent: 8/19/2009 7:17:45 PM Subject: Re: custom scorer Are you setting the Similarity before

Re: custom scorer

2009-08-19 Thread Grant Ingersoll
Are you setting the Similarity before indexing, too, on the IndexWriter? On Aug 19, 2009, at 4:20 PM, Chris Salem wrote: Hello, I'm trying to write a custom scorer that only uses the term frequency function from the DefaultSimilarity class, the problem is that documents with

custom scorer

2009-08-19 Thread Chris Salem
Hello, I'm trying to write a custom scorer that only uses the term frequency function from the DefaultSimilarity class, the problem is that documents with lower frequencies are returning with higher scores than documents with higher frequencies. Here's the code: searcher.setSimi