Exemple #1
0
 public override void SetStringValue(string value)
 {
     key          = collator.GetRawCollationKey(value, key);
     bytes.Bytes  = key.Bytes;
     bytes.Offset = 0;
     bytes.Length = key.Length;
 }
Exemple #2
0
        public override void FillBytesRef()
        {
            BytesRef bytes = this.BytesRef;

            collator.GetRawCollationKey(ToString(), key);
            bytes.Bytes  = key.Bytes;
            bytes.Offset = 0;
            bytes.Length = key.Length;
        }
Exemple #3
0
 public override bool IncrementToken()
 {
     if (m_input.IncrementToken())
     {
         char[] termBuffer = termAtt.Buffer;
         string termText   = new string(termBuffer, 0, termAtt.Length);
         collator.GetRawCollationKey(termText, reusableKey);
         int encodedLength = IndexableBinaryStringTools.GetEncodedLength(
             reusableKey.Bytes, 0, reusableKey.Length);
         if (encodedLength > termBuffer.Length)
         {
             termAtt.ResizeBuffer(encodedLength);
         }
         termAtt.SetLength(encodedLength);
         IndexableBinaryStringTools.Encode(reusableKey.Bytes, 0, reusableKey.Length,
                                           termAtt.Buffer, 0, encodedLength);
         return(true);
     }
     else
     {
         return(false);
     }
 }