lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mead Lai <laiqi...@gmail.com>
Subject Re: Return Lucene field name when a query is matched
Date Fri, 21 Oct 2011 02:11:19 GMT
you description was not clear.

a query will return lots of results,
so every item will be different on matched field name, if you use
Boolean_OR to query.

if you use boolean and, then every field will match.

Regards,
Mead


On Thu, Oct 20, 2011 at 11:22 PM, Ian Lea <ian.lea@gmail.com> wrote:

> You can work it out from the Explanation returned by
> IndexSearcher.explain method.  Note the performance warning in the
> javadocs.
>
> --
> Ian.
>
>
> On Thu, Oct 20, 2011 at 2:35 PM, Mihai Caraman <caraman.mihai@gmail.com>
> wrote:
> > So now you have something like query[title,content,header,...].
> > Evidently you can find out by query[title], query[content],
> query[header].
> > But you'd have to the merge the results. Maybe there's a collector for
> this.
> >
> > 2011/10/20 damian2b <damian2b@o2.pl>
> >
> >> Hi,
> >>
> >> I was given a task to investigate whether it is possible to return
> Lucene
> >> field name when a query is matched.
> >> At the moment our application returns the usual matched docs, but the
> new
> >> requirement would be to also know which field matched the query (e.g.
> found
> >> in title, header, etc.).
> >> We use Lucene 3.0.3.
> >>
> >> Is this doable? Any pointers please.
> >> Is this supported in newer versions of Lucene? If so this might be my
> >> recommendation. I have googled a bit, but with no luck.
> >> Any help or suggestions much appreciated.
> >>
> >> Many thanks,
> >>
> >> Damo
> >>
> >> ---------------------------------------------------------------------
> >> 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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message