You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Alessandro Benedetti <be...@gmail.com> on 2010/09/07 13:08:40 UTC
Query result ranking - Score independent
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)
)
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?
Thx
--
--------------------------
Benedetti Alessandro
Personal Page: http://tigerbolt.altervista.org
"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"
William Blake - Songs of Experience -1794 England
Re: Query result ranking - Score independent
Posted by Lance Norskog <go...@gmail.com>.
Generally speaking it is a bad idea to change the schema without
reindexing. I found several little things that could go wrong back
when I had a huge index and could not reindex.
On Wed, Sep 8, 2010 at 4:58 AM, Erick Erickson <er...@gmail.com> wrote:
> Ooops, hit send too quickly. Could you show us the entire URL you send
> that produces the error?
>
> Erick
>
> On Wed, Sep 8, 2010 at 7:58 AM, Erick Erickson <er...@gmail.com>wrote:
>
>> The change in the schema shouldn't matter (emphasis on the should).
>>
>> What version of SOLR are you using? I tried this query and it works just
>> fine for me, I'm using 1.4.1
>>
>> Best
>> Erick
>>
>>
>> On Wed, Sep 8, 2010 at 4:38 AM, Alessandro Benedetti <
>> benedetti.alex85@gmail.com> wrote:
>>
>>> My request was very simple:
>>> q= astronomy^0
>>> And Solr returned the exception.
>>> Maybe the zero boost factor is not causing the exception?
>>>
>>> 1) We indexed n documents with a Schema.xml.
>>> 2)Then we changed some field type in the Schema.xml
>>> 3)Then we indexed other m documents
>>>
>>> Maybe this could cause the exception?
>>>
>>>
>>>
>>> 2010/9/7 Grant Ingersoll <gs...@apache.org>
>>>
>>> >
>>> > 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
>>> >
>>> >
>>>
>>>
>>> --
>>> --------------------------
>>>
>>> Benedetti Alessandro
>>> Personal Page: http://tigerbolt.altervista.org
>>>
>>> "Tyger, tyger burning bright
>>> In the forests of the night,
>>> What immortal hand or eye
>>> Could frame thy fearful symmetry?"
>>>
>>> William Blake - Songs of Experience -1794 England
>>>
>>
>>
>
--
Lance Norskog
goksron@gmail.com
Re: Query result ranking - Score independent
Posted by Erick Erickson <er...@gmail.com>.
Ooops, hit send too quickly. Could you show us the entire URL you send
that produces the error?
Erick
On Wed, Sep 8, 2010 at 7:58 AM, Erick Erickson <er...@gmail.com>wrote:
> The change in the schema shouldn't matter (emphasis on the should).
>
> What version of SOLR are you using? I tried this query and it works just
> fine for me, I'm using 1.4.1
>
> Best
> Erick
>
>
> On Wed, Sep 8, 2010 at 4:38 AM, Alessandro Benedetti <
> benedetti.alex85@gmail.com> wrote:
>
>> My request was very simple:
>> q= astronomy^0
>> And Solr returned the exception.
>> Maybe the zero boost factor is not causing the exception?
>>
>> 1) We indexed n documents with a Schema.xml.
>> 2)Then we changed some field type in the Schema.xml
>> 3)Then we indexed other m documents
>>
>> Maybe this could cause the exception?
>>
>>
>>
>> 2010/9/7 Grant Ingersoll <gs...@apache.org>
>>
>> >
>> > 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
>> >
>> >
>>
>>
>> --
>> --------------------------
>>
>> Benedetti Alessandro
>> Personal Page: http://tigerbolt.altervista.org
>>
>> "Tyger, tyger burning bright
>> In the forests of the night,
>> What immortal hand or eye
>> Could frame thy fearful symmetry?"
>>
>> William Blake - Songs of Experience -1794 England
>>
>
>
Re: Query result ranking - Score independent
Posted by Erick Erickson <er...@gmail.com>.
The change in the schema shouldn't matter (emphasis on the should).
What version of SOLR are you using? I tried this query and it works just
fine for me, I'm using 1.4.1
Best
Erick
On Wed, Sep 8, 2010 at 4:38 AM, Alessandro Benedetti <
benedetti.alex85@gmail.com> wrote:
> My request was very simple:
> q= astronomy^0
> And Solr returned the exception.
> Maybe the zero boost factor is not causing the exception?
>
> 1) We indexed n documents with a Schema.xml.
> 2)Then we changed some field type in the Schema.xml
> 3)Then we indexed other m documents
>
> Maybe this could cause the exception?
>
>
>
> 2010/9/7 Grant Ingersoll <gs...@apache.org>
>
> >
> > 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
> >
> >
>
>
> --
> --------------------------
>
> Benedetti Alessandro
> Personal Page: http://tigerbolt.altervista.org
>
> "Tyger, tyger burning bright
> In the forests of the night,
> What immortal hand or eye
> Could frame thy fearful symmetry?"
>
> William Blake - Songs of Experience -1794 England
>
Re: Query result ranking - Score independent
Posted by Alessandro Benedetti <be...@gmail.com>.
My request was very simple:
q= astronomy^0
And Solr returned the exception.
Maybe the zero boost factor is not causing the exception?
1) We indexed n documents with a Schema.xml.
2)Then we changed some field type in the Schema.xml
3)Then we indexed other m documents
Maybe this could cause the exception?
2010/9/7 Grant Ingersoll <gs...@apache.org>
>
> 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
>
>
--
--------------------------
Benedetti Alessandro
Personal Page: http://tigerbolt.altervista.org
"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"
William Blake - Songs of Experience -1794 England
Re: Query result ranking - Score independent
Posted by Grant Ingersoll <gs...@apache.org>.
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