lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Willnauer <>
Subject Re: Wilcard document matches all have the same score
Date Fri, 24 Jun 2011 05:22:51 GMT
On Fri, Jun 24, 2011 at 3:08 AM, SBS <> wrote:
> I am new to Lucene 3.2 and have it working well in most cases.  However, when
> I do wildcard searches such as abc*, all the resulting matched documents
> have exactly the same score regardless of the words that matched, their
> position within the document or the size of the document.  This makes
> presenting them in some meaningful order on the screen very difficult.
> Is this the expected behaviour or have I done something wrong with my
> indexing or searching technique?  Searches not involving wildcards produce a
> range of scores as expected.
that is expected behavior. WildcardQuery is a MultiTermQuery and for
MTQ you can / have to specify a RewriteMethod that decides what kind
of primitive query is used to execute the MTQ. if you want to use
scoring you can pass MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE to
your WildcardQuery when you create it via
WildcardQuery#setRewriteMethod(...); Yet, make sure you expect a
TooManyBooleanClauses exception if your WildcardQuery expands to too
many terms. Something like a* is not a good idea :).

> Thanks,
> -sbs
> --
> View this message in context:
> Sent from the Lucene - General mailing list archive at

View raw message