views:

88

answers:

1

Currently I get all the fieldnames as follows:

//Get all fieldnames
string expectedFieldName = string.Empty;
IndexReader r = IndexReader.Open(lucenePath);
TermEnum te = r.Terms();
List<string> terms = new List<string>();
while (te.Next())
{
    terms.Add(te.Term().Field());
}
terms = terms.Distinct<string>().ToList();

But it would be much better if I could just get these 15 fieldnames instead of getting several millions and then distincting them to 15.

+1  A: 

I believe you need getFieldNames. Maybe this is a better reference.

Yuval F
Yes. Much faster, thanks :)
borisCallens