Some questions: 1) this is an unpaged query, correct?
2) does it matter how many hits the search has as to whether you get the error? E.g. if you add to your error-generating query "AND customID:x" (where x is a customID which is a hit) , do you still get the error? If there is no error with minimal hits, then assuming your error-generating query is text:"foo", try a search for "foo" AND customID:"000000000001"-"y" And increase the no. of y to establish whether your error occurs after a specific number of hits. 3) does it matter which the sort field is? 4) Can you replicate this in a situation where you have debug mode running so you can establish which is the object in question? Yours, Moray ------------------------------------- Moray McConnachie Director of IT +44 1865 261 600 Oxford Analytica http://www.oxan.com -----Original Message----- From: Luis Fco. Ramirez Daza Gonzalez [mailto:[email protected]] Sent: 13 September 2009 22:32 To: [email protected] Subject: Problem sorting fields Hi all I have a problem sorting results in some fields. The problem is new, I think because our index has grow too much lately. We use 3 different sort fields: - PrimaryKey à Numeric, with all values < Integer.MaxValue the largest value is between 5,000,000 and 10,000,000. - Custom ID à Numeric but stored as text(string) with leading zeros (12 dgitis): "000000000001" - Title à This a text field with document titles. The exception I get is: "System.Exception: Error searching index. M_2:b* Object reference not set to an instance of an object. at Lucene.Net.Search.FieldSortedHitQueue.AnonymousClassScoreDocComparator3.Comp are(ScoreDoc i, ScoreDoc j) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Search\FieldSortedHitQueue.cs:lin e 160 at Lucene.Net.Search.FieldSortedHitQueue.LessThan(Object a, Object b) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Search\FieldSortedHitQueue.cs:lin e 241 at Lucene.Net.Util.PriorityQueue.UpHeap() in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Util\PriorityQueue.cs:line 140 at Lucene.Net.Util.PriorityQueue.Put(Object element) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Util\PriorityQueue.cs:line 54 at Lucene.Net.Util.PriorityQueue.Insert(Object element) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Util\PriorityQueue.cs:line 68 at Lucene.Net.Search.IndexSearcher.AnonymousClassHitCollector1.Collect(Int32 doc, Single score) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Search\IndexSearcher.cs:line 107 at Lucene.Net.Search.Scorer.Score(HitCollector hc) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Search\Scorer.cs:line 45 at Lucene.Net.Search.IndexSearcher.Search(Query query, Filter filter, Int32 nDocs, Sort sort) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Search\IndexSearcher.cs:line 226 at Lucene.Net.Search.Hits.GetMoreDocs(Int32 min) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Search\Hits.cs:line 68 at Lucene.Net.Search.Hits..ctor(Searcher s, Query q, Filter f, Sort o) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Search\Hits.cs:line 54 at Lucene.Net.Search.Searcher.Search(Query query, Sort sort) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Search\Searcher.cs:line 55 at RATextIndexLucene.RATIdxLucene.RATIdxL.Search(String queryString, String SortBy, Boolean& bAsc) in G:\Projects\RA\General.NET3\RATextIndexLucene\Code\RATextIndexLucene\TxtIdxL ..vb:line 2328 ---> System.NullReferenceException: Object reference not set to an instance of an object. at Lucene.Net.Search.FieldSortedHitQueue.AnonymousClassScoreDocComparator3.Comp are(ScoreDoc i, ScoreDoc j) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Search\FieldSortedHitQueue.cs:lin e 160 at Lucene.Net.Search.FieldSortedHitQueue.LessThan(Object a, Object b) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Search\FieldSortedHitQueue.cs:lin e 241 at Lucene.Net.Util.PriorityQueue.UpHeap() in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Util\PriorityQueue.cs:line 140 at Lucene.Net.Util.PriorityQueue.Put(Object element) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Util\PriorityQueue.cs:line 54 at Lucene.Net.Util.PriorityQueue.Insert(Object element) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Util\PriorityQueue.cs:line 68 at Lucene.Net.Search.IndexSearcher.AnonymousClassHitCollector1.Collect(Int32 doc, Single score) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Search\IndexSearcher.cs:line 107 at Lucene.Net.Search.Scorer.Score(HitCollector hc) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Search\Scorer.cs:line 45 at Lucene.Net.Search.IndexSearcher.Search(Query query, Filter filter, Int32 nDocs, Sort sort) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Search\IndexSearcher.cs:line 226 at Lucene.Net.Search.Hits.GetMoreDocs(Int32 min) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Search\Hits.cs:line 68 at Lucene.Net.Search.Hits..ctor(Searcher s, Query q, Filter f, Sort o) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Search\Hits.cs:line 54 at Lucene.Net.Search.Searcher.Search(Query query, Sort sort) in G:\Projects\dotLucene\Code\1.4.3.004_N3.0\\Search\Searcher.cs:line 55 at RATextIndexLucene.RATIdxLucene.RATIdxL.Search(String queryString, String SortBy, Boolean& bAsc) in G:\Projects\RA\General.NET3\RATextIndexLucene\Code\RATextIndexLucene\TxtIdxL ..vb:line 2328 --- End of inner exception stack trace --- at RATextIndexLucene.RATIdxLucene.RATIdxL.Search(String queryString, String SortBy, Boolean& bAsc) in G:\Projects\RA\General.NET3\RATextIndexLucene\Code\RATextIndexLucene\TxtIdxL ..vb:line 2368 at RATextIndexLuceneTestBed.frmMain.DoSearch() in G:\Projects\RA\General.NET3\RATextIndexLucene\Code\RATextIndexLuceneTestBed\ frmMain.vb:line 2274" I get it when sorting by Title, but as the index grows I start getting it when sorting by "Custom ID" and sorting with PrimeryKey (that is an integer filed) Thanks Luis
