On Sun, Mar 4, 2012 at 6:10 PM, Benson Margulies <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
