Count search results in Lucene.Net -


i'm new lucene , want count occurences of search word in index. saw should use like:

 indexreader reader = ....... 

termdocs termdoc = reader.termdocs();

termdoc.seek(new term("my_field", mstrsearchfor));

int occurencecount = termdoc.freq();

i can't seem create indexreader start.

fsdirectory directory = fsdirectory.open(new system.io.directoryinfo("c:\\temp\\")); indexreader reader = indexreader.open(directory, true); 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

java - where to store the user credentials in an enterprise application(EAI)? -

openxml - Programmatically format a date in an excel sheet using Office Open Xml SDK -