You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by mark harwood <ma...@yahoo.co.uk> on 2010/02/15 11:29:17 UTC

Re: Further refinement of search results - distinguishing hits with exact phrase match from the rest

Re Mike's delegating custom query suggestion - see https://issues.apache.org/jira/browse/LUCENE-1999




----- Original Message ----
From: Michael McCandless <lu...@mikemccandless.com>
To: java-user@lucene.apache.org
Sent: Mon, 15 February, 2010 10:03:30
Subject: Re: Further refinement of search results - distinguishing hits with  exact phrase match from the rest

I don't think Lucene makes this easy, today, out of the box.  The
scoring process for a boolean query doesn't track which sub-clause had
matched.

Though, it does track the number of clauses that matched (coord).  EG
you'd be able to tell that a given hit had both clauses match, vs only
1 (just not which one).  But coord is not current exposed - you'd have
to modify BooleanScorer/2 to make that available per hit.

Alternatively, you could make a simple custom query that delegates all
scoring to another query, but tracks whether it matched a given
document.  Then, you'd make your own custom Collector that, on seeing
a competitive hit, also records which clause of the query had matched.

Mike

On Mon, Feb 15, 2010 at 12:19 AM, micmit <mi...@gmail.com> wrote:
>
> I run a query, say, NAME:"John Smith"^1.5 OR NAME:(Jo* Smith).
>
> Once I get the result set, is there an efficient way to identify those hits
> that match: a) "John Smith" b) Jo* Smith  ---?
>
> or perhaps to change the original query somehow ?
> --
> View this message in context: http://old.nabble.com/Further-refinement-of-search-results---distinguishing-hits-with-exact-phrase-match-from-the-rest-tp27589728p27589728.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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


      

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