I am making my way through lucene and the dead end on this subject with the Hits object. I have use Lucene.Net.Search, but for some reason 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 the using directive or assembly reference?)
I don't understand, according to the online tutorials you need, 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;
source share