@Override
 public boolean seekExact(BytesRef text) throws IOException {
   if (in.seekExact(text) == null) {
     return false;
   } else {
     return true;
   }
 }
 @Override
 public void seekExact(long ord) throws IOException {
   // TODO: would be better to make this simpler and faster.
   // but we dont want to introduce a bug that corrupts our enum state!
   bytesReader.setPosition(0);
   fst.getFirstArc(firstArc);
   IntsRef output = Util.getByOutput(fst, ord, bytesReader, firstArc, scratchArc, scratchInts);
   BytesRefBuilder scratchBytes = new BytesRefBuilder();
   scratchBytes.clear();
   Util.toBytesRef(output, scratchBytes);
   // TODO: we could do this lazily, better to try to push into FSTEnum though?
   in.seekExact(scratchBytes.get());
 }
Esempio n. 3
0
 @Override
 public boolean seekExact(BytesRef target) throws IOException {
   updateEnum(fstEnum.seekExact(target));
   return term != null;
 }