lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Muir <rcm...@gmail.com>
Subject Re: which fields are included in similarity?
Date Mon, 05 Mar 2012 16:09:29 GMT
On Sun, Mar 4, 2012 at 6:10 PM, Benson Margulies <bimargulies@gmail.com> wrote:
>   TopDocs top = searcher.search(contextQuery, filter, maxDocsToRetrieve);
>
> Which document fields are included in the calculation of the scores in
> the returned items? All fields? All fields touched in the query? Would
> I need a custom Similarity to exclude some?

It depends upon the query. But if certain parts of the query should
not contribute to the score, what is their purpose?

If its solely to restrict matching and should not affect the score,
consider wrapping in ConstantScoreQuery or, if these restrictions are
re-used across queries, consider a filter.
And of course, if these fields are always used in this way, you can
consider omitting norms (as you dont need length normalization, you
arent scoring!), and if you don't need positional 'filters'
you can probably omit freqs and positions too (IndexOptions.DOCS_ONLY)

(You can in trunk, fully tweak scoring on a per-field basis in
Similarity, but I don't think thats the right way to go)

-- 
lucidimagination.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message