Getting the Doc ID in Lucene
.net, lucene, lucene.net
Solution
Turns out you have to do this:
var hits = searcher.Search(query);
var result = hits.Id(0);
As opposed to
var results = hits.Doc(i);
var docid = results.<...> //there's nothing I could find there to do this
Problem
In lucene, I can do the following ``` doc.GetField("mycustomfield").StringValue(); ``` This retrieves the value of a column in an index's document. My question, for the same `'doc'`, is there a way to get the `Doc. Id` ? Luke displays it hence there must be a way to figure this out. I need it to delete documents on updates. I scoured the docs but have not found the term to use in GetField or if there already is another method.