lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Dunning <ted.dunn...@gmail.com>
Subject Re: How to structure lucene query?
Date Sun, 07 Jun 2009 18:32:12 GMT
In that case, you need to build a bunch of user "documents" which are the
union of the fields in question.

Then the retrieval is trivial.

On Sun, Jun 7, 2009 at 7:28 AM, ywlee522 <ywlee522@gmail.com> wrote:

>
> Thanks for the tip.  But, no, it is not same as finding documents with both
> "ABC" and "XYZ", as they can be appear in separate documents of the same
> user.
>
>
>
>
> Ted Dunning wrote:
> >
> > It is the same as finding documents with both "ABC" and "XYZ" except that
> > you need to run over the results yourself and collect the user names.
> >
> > Lucene doesn't have a fancy query language so you can't magically do any
> > group-by or count(distinct) tricks.
> >
> > On Sat, Jun 6, 2009 at 8:59 AM, ywlee522 <ywlee522@gmail.com> wrote:
> >
> >>
> >>
> >> A document has two fields; username, date, and document text. A user can
> >> have multiple documents.
> >>
> >> The query is:
> >>
> >> Of the users who have one or more documents with keyword "ABC", find
> >> users
> >> who also have one or more document with keyword "XYZ".
> >>
> >> This isn't finding documents with both "ABC" and "XYZ".   How can this
> be
> >> done in lucene query? THANK YOU
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/How-to-structure-lucene-query--tp23902784p23902784.html
> >> Sent from the Lucene - General mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Ted Dunning, CTO
> > DeepDyve
> >
> > 111 West Evelyn Ave. Ste. 202
> > Sunnyvale, CA 94086
> > http://www.deepdyve.com
> > 858-414-0013 (m)
> > 408-773-0220 (fax)
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/How-to-structure-lucene-query--tp23902784p23911598.html
> Sent from the Lucene - General mailing list archive at Nabble.com.
>
>


-- 
Ted Dunning, CTO
DeepDyve

111 West Evelyn Ave. Ste. 202
Sunnyvale, CA 94086
http://www.deepdyve.com
858-414-0013 (m)
408-773-0220 (fax)

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