Hello,

Create Term from field name and emty valu
Call read->terms( Term * ) to get term enum
Use TermDocs together with TermEnum to get related document ids

RangeQuery::rewrite(IndexReader* reader) could be a good example I think

This way is very efficient, but you should not read other document field values 
inside this cycle

Regards

Borek

From: norbert barichard [mailto:norbert.barich...@diginext.fr]
Sent: Monday, January 26, 2015 4:37 PM
To: clucene-developers@lists.sourceforge.net
Subject: [CLucene-dev] Retrieve all values for a given field ?

Hello, me again, with yet another CLucene question !

I would like to retrieve (in a relatively fast way) all the values for a given 
field. For example, if my index looks like :
Document1 ( fieldName=value1 )
Document2 (fieldName=value1 )
Document3 (fieldName=value2 )
Document4 (fieldName=value2 )

I'd like to be able to call something like getFieldValues( "fieldName" ) and 
get a list ( value1, value2 ) in return.

How can I do that ?

Thanks in advance
--
[cid:image001.png@01D03A1A.DCC17110]
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers

Reply via email to