You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by GitBox <gi...@apache.org> on 2020/07/30 16:24:30 UTC

[GitHub] [lucenenet] mlaufer commented on issue #296: IndexOutOfRangeException when searching

mlaufer commented on issue #296:
URL: https://github.com/apache/lucenenet/issues/296#issuecomment-666504940


   Hi @NightOwl888,
   
   I can basically confirm the behavior described here when using FuzzyQuery, most of the times it works, but sometimes searches fail with a pretty similar exception tho: 
   
   `System.IndexOutOfRangeException: Index was outside the bounds of the array.
      at Lucene.Net.Util.Automaton.UTF32ToUTF8.Convert(Automaton utf32)
      at Lucene.Net.Util.Automaton.CompiledAutomaton..ctor(Automaton automaton, Nullable`1 finite, Boolean simplify)
      at Lucene.Net.Search.FuzzyTermsEnum.InitAutomata(Int32 maxDistance)
      at Lucene.Net.Search.FuzzyTermsEnum.GetAutomatonEnum(Int32 editDistance, BytesRef lastTerm)
      at Lucene.Net.Search.FuzzyTermsEnum.MaxEditDistanceChanged(BytesRef lastTerm, Int32 maxEdits, Boolean init)
      at Lucene.Net.Search.FuzzyTermsEnum..ctor(Terms terms, AttributeSource atts, Term term, Single minSimilarity, Int32 prefixLength, Boolean transpositions)
      at Lucene.Net.Search.FuzzyQuery.GetTermsEnum(Terms terms, AttributeSource atts)
      at Lucene.Net.Search.TermCollectingRewrite`1.CollectTerms(IndexReader reader, MultiTermQuery query, TermCollector collector)
      at Lucene.Net.Search.TopTermsRewrite`1.Rewrite(IndexReader reader, MultiTermQuery query)
      at Lucene.Net.Search.BooleanQuery.Rewrite(IndexReader reader)
      at Lucene.Net.Search.BooleanQuery.Rewrite(IndexReader reader)
      at Lucene.Net.Search.BooleanQuery.Rewrite(IndexReader reader)
      at Lucene.Net.Search.IndexSearcher.Rewrite(Query original)
      at Lucene.Net.Search.IndexSearcher.CreateNormalizedWeight(Query query)
      at Lucene.Net.Search.IndexSearcher.Search(Query query, Int32 n, Sort sort)`
   
   We are using Lucene 4.8. For now, we are "solving" this by using a try catch around the Search() and catch it to do retry of the search, which greatly reduces the amount of failed searches.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org