I am having an issue with the below code.
The code throws the following exception:
System.IndexOutOfRangeException: Index was outside the bounds of the array. at Lucene.Net.Search.AnonymousClassLongParser1.ParseLong(String val) at Lucene.Net.Search.FieldCacheImpl.LongCache.CreateValue(IndexReader reader, Entry entryKey) at Lucene.Net.Search.FieldCacheImpl.Cache.Get(IndexReader reader, Entry key) at Lucene.Net.Search.FieldCacheImpl.GetLongs(IndexReader reader, String field, LongParser parser) at Lucene.Net.Search.FieldCacheImpl.LongCache.CreateValue(IndexReader reader, Entry entryKey) at Lucene.Net.Search.FieldCacheImpl.Cache.Get(IndexReader reader, Entry key) at Lucene.Net.Search.FieldCacheImpl.GetLongs(IndexReader reader, String field, LongParser parser) at Lucene.Net.Search.FieldComparator.LongComparator.SetNextReader(IndexReader reader, Int32 docBase) at Lucene.Net.Search.TopFieldCollector.OneComparatorNonScoringCollector.SetNextReader(IndexReader reader, Int32 docBase) at Lucene.Net.Search.IndexSearcher.Search(Weight weight, Filter filter, Collector collector) at Lucene.Net.Search.IndexSearcher.Search(Weight weight, Filter filter, Int32 nDocs, Sort sort, Boolean fillFields) at Lucene.Net.Search.IndexSearcher.Search(Weight weight, Filter filter, Int32 nDocs, Sort sort) at Lucene.Net.Search.Searcher.Search(Query query, Filter filter, Int32 n, Sort sort) at Dynamicweb.Indexing.Lucene.LuceneIndexProvider.SearchInternal(IQuery query, QuerySettings settings) at Dynamicweb.Indexing.Lucene.LuceneIndexProvider.Query(IQuery query, QuerySettings settings) at Dynamicweb.Indexing.Queries.IndexQueryProvider.Query(IQuery query, QuerySettings settings) at Dynamicweb.Indexing.Querying.QueryService.Query(IQuery query, QuerySettings settings) at Backend.Repositories.<snip>()
However, if I remove the sortOrder from the query, everything runs just fine.
I'm on a time constraint and will probably just handle this in memory, but I'd like to know the reason why this is happening so I can avoid it in the future.
Is anyone able to explain to me what is happening?
Best Regards,
Kasper