From: Kostka B. <ko...@to...> - 2015-01-27 09:30:49
|
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:nor...@di...] Sent: Monday, January 26, 2015 4:37 PM To: clu...@li... 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] |