Akanksha Baid wrote:
I have indexed multiple documents - each of them have 3 fields ( id, tag
, text). Is there an easy way to determine the set of tags for a given
query without iterating through all the hits?
For example if I have 100 documents in my index and my set of tag = {A,
B, C}. Query
You could go through this implementation. Have been using this (improvised)
for a while now. There might be better ways to do so too. so you could
check!
http://www.gossamer-threads.com/lists/lucene/java-user/35704?search_string=categorycounts;#35704
--
Anshum Gupta
Naukri Labs!
http://ai-cafe.blo
Hi, You may also want to take a look at Carrot2:
http://demo.carrot2.org/demo-stable/main
Lucene documentation references them, but I was disappointed to see that
they had an open source version (really old) and one that you can buy. It
may work for you.
Also, take a look at SOLR's implementatio
: For example if I have 100 documents in my index and my set of tag = {A, B, C}.
: Query Q on the text field returns 15 docs with tag A , 10 with tag B and none
: with tag C (total of 25 hits). Is there a way to determine that the set of
: tags for query Q = {A, B} without iterating through all 25
Is there something I could do to Index the documents differently to
accomplish this? Currently I am looking at all the hits to generate the
set of tags for the query.
If I need to implement the same thing within Lucene, I am not sure if I
will gain anything performance wise. Or am I wrong about
Hi,
You could try changing (or extending) TopFieldDocCollector and do your
processing there (that is what I tried... and it worked fine). But that
would mean changing lucene code a little bit.
--
Anshum Gupta
Naukri Labs!
http://ai-cafe.blogspot.com
The facts expressed here belong to everybody,