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 "Jason, Kim" <hi...@gmail.com> on 2011/06/13 08:22:44 UTC

disable sort by score

Hi, All
I want to get the search result which is not sorted by anything.
Sorting by score take more time.
So, I want to disable sorting by score.
How can i do this?

Thanks, Jason.



--
View this message in context: http://lucene.472066.n3.nabble.com/disable-sort-by-score-tp3057767p3057767.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: disable sort by score

Posted by Ahmet Arslan <io...@yahoo.com>.

--- On Tue, 6/14/11, Jason, Kim <hi...@gmail.com> wrote:

> From: Jason, Kim <hi...@gmail.com>
> Subject: Re: disable sort by score
> To: solr-user@lucene.apache.org
> Date: Tuesday, June 14, 2011, 6:57 AM
> Thanks to reply, Erick!
> 
> Actually, I need sort by score.
> I was just curious that seach result without sorting is
> possible.
> Then I found
> http://lucene.472066.n3.nabble.com/MaxRows-and-disabling-sort-td2260650.html
> In above context, Chris Hostetter-3 wrote
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> http://wiki.apache.org/solr/CommonQueryParameters#sort
> "You can sort by index id using sort=_docid_ asc or
> sort=_docid_ desc"
> 
> if you specify _docid_ asc then solr should return as soon
> as it finds the
> first N matching results w/o scoring all docs (because no
> score will be
> computed) 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 
> I tried to check perfomance using _docid_ asc.
> But _docid_ didn't work in distributed search.
> So I made inquiries to know that another method is.

In lucene it is possible with Collector.

"...Collector decouples the score from the collected doc: the score computation is skipped entirely if it's not needed. Collectors that do need the score should implement the..." [1]

[1]http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/search/Collector.html

But i am not sure how to plug it to solr. There has been some discussion about it. 

http://search-lucene.com/?q=custom+collector&fc_project=Solr&fc_type=mail+_hash_+user

Re: disable sort by score

Posted by "Jason, Kim" <hi...@gmail.com>.
Thanks to reply, Erick!

Actually, I need sort by score.
I was just curious that seach result without sorting is possible.
Then I found
http://lucene.472066.n3.nabble.com/MaxRows-and-disabling-sort-td2260650.html
In above context, Chris Hostetter-3 wrote
++++++++++++++++++++++++++++++++++++++++++++++++++++++
http://wiki.apache.org/solr/CommonQueryParameters#sort
"You can sort by index id using sort=_docid_ asc or sort=_docid_ desc"

if you specify _docid_ asc then solr should return as soon as it finds the
first N matching results w/o scoring all docs (because no score will be
computed) 
++++++++++++++++++++++++++++++++++++++++++++++++++++++

I tried to check perfomance using _docid_ asc.
But _docid_ didn't work in distributed search.
So I made inquiries to know that another method is.

Best
Jason

--
View this message in context: http://lucene.472066.n3.nabble.com/disable-sort-by-score-tp3057767p3061753.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: disable sort by score

Posted by Erick Erickson <er...@gmail.com>.
Can you back up and explain why you have this requirement?
Disabling ranking by relevance is fairly unusual in any decent
sized application.

And before you jump into this as a solution, have you tried
other ways of increasing performance? This may be an "XY"
problem, see:

Your question appears to be an "XY Problem" ... that is: you are dealing
with "X", you are assuming "Y" will help you, and you are asking about "Y"
without giving more details about the "X" so that we can understand the
full issue.  Perhaps the best solution doesn't involve "Y" at all?
See Also: http://www.perlmonks.org/index.pl?node_id=542341
(from http://people.apache.org/~hossman/#xyproblem)

Best
Erick


On Mon, Jun 13, 2011 at 2:22 AM, Jason, Kim <hi...@gmail.com> wrote:
> Hi, All
> I want to get the search result which is not sorted by anything.
> Sorting by score take more time.
> So, I want to disable sorting by score.
> How can i do this?
>
> Thanks, Jason.
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/disable-sort-by-score-tp3057767p3057767.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>