On Sep 7, 2010, at 7:08 AM, Alessandro Benedetti wrote:

> Hi all,
> I need to retrieve query-results with a ranking independent from each
> query-result's default lucene score, which means assigning the same score to
> each query result.
> I tried to use a zero boost factor ( ^0 ) to reset to zero each
> query-result's score.
> This strategy seems to work within the "example" solr instance, but in my
> Solr instance, using a zero boost factor causes a Buffer Exception
> (
> HTTP Status 500 - null java.lang.IllegalArgumentException at
> java.nio.Buffer.limit(Buffer.java:249) at
> org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput.readInternal(NIOFSDirectory.java:123)
> at
> org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:157)
> at
> org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:38)
> at org.apache.lucene.store.IndexInput.readInt(IndexInput.java:70) at
> org.apache.lucene.store.IndexInput.readLong(IndexInput.java:93) at
> org.apache.lucene.index.FieldsReader.doc(FieldsReader.java:210) at
> org.apache.lucene.index.SegmentReader.document(SegmentReader.java:948) at
> org.apache.lucene.index.DirectoryReader.document(DirectoryReader.java:506)
> at org.apache.lucene.index.IndexReader.document(IndexReader.java:947)
> )

Hmm, that stack trace doesn't align w/ the boost factor.  What  was your 
request?  I think there might be something else wrong here.

> Do you know any other technique to reset to some fixed constant value, all
> the query-result's scores?
> Each query result should obtain the same score.
> Any suggestion?


The ConstantScoreQuery or a Filter should do this.  You could do something like:

&q=*:*&fq=<the real query>, as in &q=*:*&fq=field:foo

-Grant


--------------------------
Grant Ingersoll
http://lucenerevolution.org Apache Lucene/Solr Conference, Boston Oct 7-8

Reply via email to