Possible to "quickly" fetch count of other terms based on a query

2013-02-22 Thread Lars-Erik Aabech
Hi! I'm sorry I didn't do any hard research on this, it's so quick to ask. ;) Is it possible to somehow find the count of each term in a set for each document returned by a query? For instance, if I use the query +(foo:bar foo:morebar) +(bar:foo), Could I without fetching all the documents from

Re: Possible to "quickly" fetch count of other terms based on a query

2013-02-22 Thread Michael McCandless
For terms that are in your query, you could use the Scorer.getChildScorers API up front to hold onto each Scorer and then in a custom collector check if that Scorer matched this particular hit. For terms that are not in your query.: You could use term vectors and count up the terms yourself a

RE: Possible to "quickly" fetch count of other terms based on a query

2013-02-22 Thread Lars-Erik Aabech
Thanks. ANDing was what I ment with "combined" queries. I think I'll go with that one for now and see how it performs. Not too many docs/terms in the index. (~1500/30) Bit sets sounds appealing, but I've got no idea how to go about it. :) In "lucene in action", I only find a short mention of Doc

Re: Possible to "quickly" fetch count of other terms based on a query

2013-02-22 Thread Michael McCandless
On Fri, Feb 22, 2013 at 6:08 AM, Lars-Erik Aabech wrote: > Thanks. > > ANDing was what I ment with "combined" queries. > I think I'll go with that one for now and see how it performs. Not too many > docs/terms in the index. (~1500/30) > > Bit sets sounds appealing, but I've got no idea how to go

RE: Possible to "quickly" fetch count of other terms based on a query

2013-02-22 Thread Lars-Erik Aabech
I guess it performs alright :P Overall Elapsed:00:00:00.0290029 (29ms) Lars-Erik -Original Message- From: Lars-Erik Aabech [mailto:l...@markedspartner.no] Sent: 22. februar 2013 12:09 To: java-user@lucene.apache.org Subject: RE: Possible to "quickly" fetch count of other

RE: Possible to "quickly" fetch count of other terms based on a query

2013-02-22 Thread Lars-Erik Aabech
Thanks again. I'll look into this at a later time. :) (Have to read the entire book too..) -Original Message- From: Michael McCandless [mailto:luc...@mikemccandless.com] Sent: 22. februar 2013 12:21 To: java-user@lucene.apache.org Subject: Re: Possible to "quickly" fetch count of other te