LookupTerm() public method

Returns the term (BytesRef) corresponding to the provided ordinal.
public LookupTerm ( Lucene.Net.Index.TermsEnum termsEnum, int ord ) : BytesRef
termsEnum Lucene.Net.Index.TermsEnum
ord int
return BytesRef
Example #1
0
            public override void LookupOrd(long ord, BytesRef result)
            {
                BytesRef @ref = null;

                try
                {
                    @ref = OuterInstance.LookupTerm(Te, (int)ord);
                }
                catch (System.IO.IOException e)
                {
                    throw new Exception(e.Message, e);
                }
                result.Bytes  = @ref.Bytes;
                result.Offset = @ref.Offset;
                result.Length = @ref.Length;
            }
Example #2
0
            public override void LookupOrd(long ord, BytesRef result)
            {
                BytesRef @ref = null;

                try
                {
                    @ref = outerInstance.LookupTerm(te, (int)ord);
                }
                catch (IOException e)
                {
                    throw new Exception(e.ToString(), e);
                }
                result.Bytes  = @ref.Bytes;
                result.Offset = @ref.Offset;
                result.Length = @ref.Length;
            }
Example #3
0
            public override void LookupOrd(long ord, BytesRef result)
            {
                BytesRef @ref /* = null*/; // LUCENENET: IDE0059: Remove unnecessary value assignment

                try
                {
                    @ref = outerInstance.LookupTerm(te, (int)ord);
                }
                catch (Exception e) when(e.IsIOException())
                {
                    throw RuntimeException.Create(e);
                }
                result.Bytes  = @ref.Bytes;
                result.Offset = @ref.Offset;
                result.Length = @ref.Length;
            }