dimanche 28 septembre 2014

lucene.net sort not working access violation


Vote count:

0




I am trying to sort my results in lucene


I keep getting this error however


An unhandled exception of type 'System.AccessViolationException' occurred in Search.dll


Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.


I have tried setting Field.Index to analysed and not analysed but no joy.



Analyzer analyzer = new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29);

var parser = new QueryParser(Lucene.Net.Util.Version.LUCENE_29, "Title", analyzer);
Query query = parser.Parse(searchTerm.Trim() + "*");

var searcher = new IndexSearcher(directory, true);

var sortBy = new Lucene.Net.Search.Sort(new Lucene.Net.Search.SortField("Title", Lucene.Net.Search.SortField.STRING, true));

var filter = new QueryWrapperFilter(query);
// TopDocs topDocs3 = searcher.Search(query, filter, 500,sortBy);
// TopDocs topDocs = searcher.Search(query,500);
TopDocs topDocs2 = searcher.Search(query,null, 500, new Sort(new SortField("Title", SortField.STRING)));


var re= searcher.Search(query, null, 10, new Sort(new SortField("id", SortField.INT, true)));


asked 1 min ago







lucene.net sort not working access violation

Aucun commentaire:

Enregistrer un commentaire