Get all lucene values that have a certain fieldNam

2019-07-09 03:21发布

To solve this problem I created a new Lucene index where all possible distincted values of each field are indexed seperatly.

So it's an index with a few thousand docs that have a single Term.
I want to extract all the values for a certain term. For example, I would like all values that have the fieldName "companyName".
Defining a WildcardQuery is off course not a solution. Neither is enumerating ALL fields and only saving the ones with the correct fieldName.

标签: c# lucene
1条回答
霸刀☆藐视天下
2楼-- · 2019-07-09 03:31

This should work (I take it it still is in C#)

IndexReader.Open(/* path to index */).Terms(new Term("companyName", String.Empty));
查看更多
登录 后发表回答