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 Chris Hostetter <ho...@fucit.org> on 2009/12/07 21:00:52 UTC

Re: comparing index-time boost and sort in the case of a date field

: 
: I have a requirement where I need to display records with more recent values
: for approval_dt to come first when a query is made. I thought of approaching
: this in 2 different ways:-

	...

: 2. INDEX-TIME boosting.
: I sorted the query from databse itself in asc order of approval_dt while
: creating my input xml and while creating each *<doc>* gave it a boost
: increment by 0.1 starting from 1.01. Those records which don't have a value

index time boosts are folded info the fieldNorm which is float indexed 
using a compressed "buyte" incoding, so many initial values all collapse 
down to the same final value -- which means you aren't going to get the 
granulatiry you want from index time booksts like 1.01 and 1.02 even if 
you do every thing else perfectly.

if you have the luxary of sorting your docs before indexing them, then you 
should sort them by approval_dt *descending* and then iterate over them 
and add them to the index.  then you can use the new "_docid_ asc" sort 
syntax added in Solr 1.4

Ascending sord by internal docid (ie: the order that documents are 
indexed) is essentially free in Lucene/Solr -- so you should find that 
much faster then sorting by an explicit field (or even sorting by score)



-Hoss