Hi- Here is how it works: Lucene uses TF/DF as the "relevance" formula. This means "term frequency divided by document frequency", or the number of times a term appears in one document over the number of documents that term appears in.
This is the basic idea: suppose there are 10 documents say "swingline" and 5 have "stapler" and 2 have "red". You search for the words swingline, stapler, and red. Swingline will be 1/10, stapler will be 1/5 and red will be 1/2. (What happens in Lucene is more complex, but this is the base.) This formula is time-honored for searching text documents like newspaper articles and technical papers. For product names, book and movie titles, etc. it may not be the right tool for the job. It sounds like you want the TF part without the DF? That is, what matters is that the document has word X, and the presence of X in other documents does not matter. To do this in Solr 1.3 or 1.4, you will need a custom Similarity class. This is a subclass of DefaultSimilarity where you change how TF and DF are calculated. In solrconfig.xml it shows where you would configure this. To deploy it, create a separate jar and add that to solr/lib. On the trunk, there are (or will be) function queries that allow you to get this behavior without supplying a class. Lance Norskog On Sun, Aug 29, 2010 at 1:10 PM, Hasnain <hasn...@hotmail.com> wrote: > > also my request handler looks like this > > <requestHandler name="mb_artists" class="solr.SearchHandler"> > <lst name="defaults"> > <str name="defType">dismax</str> > <str name="qf">name ^2.4</str> > <str name="tie">0.1</str> > </lst> > </requestHandler> > > I really need some help on this, > again, what I want is...if I search for "swingline red stapler", In results, > docs that have all three keywords should come on top, then docs that have > any 2 keywords and then docs with 1 keyword, i mean in my sorted order. > thanks > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Search-Results-optimization-tp1129374p1385572.html > Sent from the Solr - User mailing list archive at Nabble.com. > -- Lance Norskog goks...@gmail.com