I am working my way through lucene and been stumped on this issue with the Hits object. I have a Using Lucene.Net.Search but for some reason the VS12 Express cannot find the Hits object so the following fails to compile.
The compiler complains about this line
Hits hits = searcher.Search(booleanQuery, hits_limit);
with the following error message
Error 1 The type or namespace name 'Hits' could not be found (are you missing a using directive or an assembly reference?)
I do not get it, according to the online tutorials alk you need is Lucnen.Net.Search
Any Advice
// validation
if (subqueries.Count == 0) return new List<MATS_Doc>();
// set up lucene searcher
Searcher searcher = new IndexSearcher(_directory, false);
var hits_limit = 1000;
var analyzer = new StandardAnalyzer(Version.LUCENE_30);
BooleanQuery booleanQuery = new BooleanQuery();
foreach (Query fieldQuery in subqueries)
{
booleanQuery.Add(fieldQuery, Occur.SHOULD);
}
//var parser = new QueryParser(Version.LUCENE_30, searchField, analyzer);
//var query = _parseQuery(searchQuery, parser);
Hits hits = searcher.Search(booleanQuery, hits_limit);
IEnumerable<MATS_Doc> results = _mapLuceneSearchResultsToDataList(hits, searcher);
analyzer.Close();
searcher.Dispose();
return results;