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

 

Reply via email to