lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Willnauer <>
Subject Re: Non matched terms
Date Fri, 12 Nov 2010 07:30:26 GMT
I assume that you don't use trunk and you don't have access to the new
Scorer#visitScorers(ScorerVisitor<Query, Query, Scorer> visitor)
methods which would make that little easier I guess. Yet, what you
could do is you could override TermQuery and wrap the created scorer
such that you set a flag if and only if that scorer scores a document
(which corresponds to a match then). that way you can afterwards
easily figure out what parts of you query did or did not match.

does that help?


On Thu, Nov 11, 2010 at 2:41 AM, Brian C. Dilley <> wrote:
> Hi, I'm using Lucene for a search project and I have the following
> requirements and I was wondering if one of you fine folks could point me
> in the right direction (currently i'm using the RAMDirectory,
> IndexSearcher, StandardAnalyzer and QueryParser):
> Given the example search string:
> "red leather calvin klein shiny pants"
> I will be searching 2 indexes.  One is an index of category names the
> other is an index of attributes.  Lets say the following happens:
> red - matches an attribute
> leather - matches an attribute
> calvin klein - matches an antribute
> pants - matches a category
> shiny - matches nothing.
> I want to identify the non-matching "shiny" search term.  That is, given
> a search string i want lucene to tell me what part(s) of it don't match
> anything.
> Is this possible?  I've tried using extractTerms (along with another API
> call that I am forgetting the name of right now) but it doesn't work for
> all Query types (ie: Fuzzy).
> Thanks in advance!
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message