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 2021/10/19 08:32:49 UTC

[GitHub] [lucenenet] monco83 commented on issue #527: ArgumentNullException with BlendedInfixSuggester (v. 4.8.0-beta00014)

monco83 commented on issue #527:
URL: https://github.com/apache/lucenenet/issues/527#issuecomment-946485152


   Thank you for your advice.
   
   I changed `PlaceIterator` based on your suggestions and InputArrayEnumerator but still get the same error on DoLookup ('Value cannot be null...').
   ```cs
   class PlaceIterator : IInputEnumerator
   {
       private readonly IEnumerator<PlaceItem> _enumerator;
   
       private PlaceItem _current = null;
       public BytesRef Current => _current != null ? new BytesRef(_current.Key) : null;
   
       public IComparer<BytesRef> Comparer => null;
       public long Weight => 0;
       public BytesRef Payload => null;
       public bool HasPayloads => false;
       public ICollection<BytesRef> Contexts => Array.Empty<BytesRef>();
       public bool HasContexts => false;
   
       public PlaceIterator(IEnumerable<PlaceItem> placeItems)
       {
           _enumerator = placeItems.GetEnumerator();
   
           if (_enumerator.MoveNext())
           {
               first = true;
               _current = _enumerator.Current;
           }
       }
   
       private bool first;
   
       public bool MoveNext()
       {
           if (first && _current != null)
           {
               first = false;
           }
           else if (_enumerator.MoveNext())
           {
               _current = _enumerator.Current;
           }
           else
           {
               _current = null;
               return false;
           }
   
           return true;
       }
   }
   ```
   


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

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