Java 类org.apache.lucene.index.TermState 实例源码

项目:lams    文件:SegmentTermsEnum.java   
@Override
public void seekExact(BytesRef target, TermState otherState) {
  // if (DEBUG) {
  //   System.out.println("BTTR.seekExact termState seg=" + segment + " target=" + target.utf8ToString() + " " + target + " state=" + otherState);
  // }
  assert clearEOF();
  if (target.compareTo(term.get()) != 0 || !termExists) {
    assert otherState != null && otherState instanceof BlockTermState;
    currentFrame = staticFrame;
    currentFrame.state.copyFrom(otherState);
    term.copyBytes(target);
    currentFrame.metaDataUpto = currentFrame.getTermBlockOrd();
    assert currentFrame.metaDataUpto > 0;
    validIndexPrefix = 0;
  } else {
    // if (DEBUG) {
    //   System.out.println("  skip seek: already on target state=" + currentFrame.state);
    // }
  }
}
项目:lams    文件:MultiPhraseQuery.java   
public UnionDocsAndPositionsEnum(Bits liveDocs, AtomicReaderContext context, Term[] terms, Map<Term,TermContext> termContexts, TermsEnum termsEnum) throws IOException {
  List<DocsAndPositionsEnum> docsEnums = new LinkedList<>();
  for (int i = 0; i < terms.length; i++) {
    final Term term = terms[i];
    TermState termState = termContexts.get(term).get(context.ord);
    if (termState == null) {
      // Term doesn't exist in reader
      continue;
    }
    termsEnum.seekExact(term.bytes(), termState);
    DocsAndPositionsEnum postings = termsEnum.docsAndPositions(liveDocs, null, DocsEnum.FLAG_NONE);
    if (postings == null) {
      // term does exist, but has no positions
      throw new IllegalStateException("field \"" + term.field() + "\" was indexed without position data; cannot run PhraseQuery (term=" + term.text() + ")");
    }
    cost += postings.cost();
    docsEnums.add(postings);
  }

  _queue = new DocsQueue(docsEnums);
  _posList = new IntQueue();
}
项目:Elasticsearch    文件:BlendedTermQuery.java   
private TermContext adjustTTF(TermContext termContext, long sumTTF) {
    if (sumTTF == -1 && termContext.totalTermFreq() == -1) {
        return termContext;
    }
    TermContext newTermContext = new TermContext(termContext.topReaderContext);
    List<LeafReaderContext> leaves = termContext.topReaderContext.leaves();
    final int len;
    if (leaves == null) {
        len = 1;
    } else {
        len = leaves.size();
    }
    int df = termContext.docFreq();
    long ttf = sumTTF;
    for (int i = 0; i < len; i++) {
        TermState termState = termContext.get(i);
        if (termState == null) {
            continue;
        }
        newTermContext.register(termState, i, df, ttf);
        df = 0;
        ttf = 0;
    }
    return newTermContext;
}
项目:search    文件:OrdsSegmentTermsEnum.java   
@Override
public void seekExact(BytesRef target, TermState otherState) {
  // if (DEBUG) {
  //   System.out.println("BTTR.seekExact termState seg=" + segment + " target=" + target.utf8ToString() + " " + target + " state=" + otherState);
  // }
  assert clearEOF();
  if (target.compareTo(term.get()) != 0 || !termExists) {
    assert otherState != null && otherState instanceof BlockTermState;
    BlockTermState blockState = (BlockTermState) otherState;
    currentFrame = staticFrame;
    currentFrame.state.copyFrom(otherState);
    term.copyBytes(target);
    currentFrame.metaDataUpto = currentFrame.getTermBlockOrd();
    currentFrame.termOrd = blockState.ord+1;
    assert currentFrame.metaDataUpto > 0;
    validIndexPrefix = 0;
  } else {
    // if (DEBUG) {
    //   System.out.println("  skip seek: already on target state=" + currentFrame.state);
    // }
  }
  positioned = true;
}
项目:search    文件:IDVersionSegmentTermsEnum.java   
@Override
public void seekExact(BytesRef target, TermState otherState) {
  // if (DEBUG) {
  //   System.out.println("BTTR.seekExact termState seg=" + segment + " target=" + target.utf8ToString() + " " + target + " state=" + otherState);
  // }
  assert clearEOF();
  if (target.compareTo(term.get()) != 0 || !termExists) {
    assert otherState != null && otherState instanceof BlockTermState;
    currentFrame = staticFrame;
    currentFrame.state.copyFrom(otherState);
    term.copyBytes(target);
    currentFrame.metaDataUpto = currentFrame.getTermBlockOrd();
    assert currentFrame.metaDataUpto > 0;
    validIndexPrefix = 0;
  } else {
    // if (DEBUG) {
    //   System.out.println("  skip seek: already on target state=" + currentFrame.state);
    // }
  }
}
项目:search    文件:SegmentTermsEnum.java   
@Override
public void seekExact(BytesRef target, TermState otherState) {
  // if (DEBUG) {
  //   System.out.println("BTTR.seekExact termState seg=" + segment + " target=" + target.utf8ToString() + " " + target + " state=" + otherState);
  // }
  assert clearEOF();
  if (target.compareTo(term.get()) != 0 || !termExists) {
    assert otherState != null && otherState instanceof BlockTermState;
    currentFrame = staticFrame;
    currentFrame.state.copyFrom(otherState);
    term.copyBytes(target);
    currentFrame.metaDataUpto = currentFrame.getTermBlockOrd();
    assert currentFrame.metaDataUpto > 0;
    validIndexPrefix = 0;
  } else {
    // if (DEBUG) {
    //   System.out.println("  skip seek: already on target state=" + currentFrame.state);
    // }
  }
}
项目:search    文件:MultiPhraseQuery.java   
public UnionDocsAndPositionsEnum(Bits liveDocs, AtomicReaderContext context, Term[] terms, Map<Term,TermContext> termContexts, TermsEnum termsEnum) throws IOException {
  List<DocsAndPositionsEnum> docsEnums = new LinkedList<>();
  for (int i = 0; i < terms.length; i++) {
    final Term term = terms[i];
    TermState termState = termContexts.get(term).get(context.ord);
    if (termState == null) {
      // Term doesn't exist in reader
      continue;
    }
    termsEnum.seekExact(term.bytes(), termState);
    DocsAndPositionsEnum postings = termsEnum.docsAndPositions(liveDocs, null, DocsEnum.FLAG_NONE);
    if (postings == null) {
      // term does exist, but has no positions
      throw new IllegalStateException("field \"" + term.field() + "\" was indexed without position data; cannot run PhraseQuery (term=" + term.text() + ")");
    }
    cost += postings.cost();
    docsEnums.add(postings);
  }

  _queue = new DocsQueue(docsEnums);
  _posList = new IntQueue();
}
项目:NYBC    文件:PulsingPostingsReader.java   
@Override
public void copyFrom(TermState _other) {
  super.copyFrom(_other);
  PulsingTermState other = (PulsingTermState) _other;
  postingsSize = other.postingsSize;
  if (other.postingsSize != -1) {
    if (postings == null || postings.length < other.postingsSize) {
      postings = new byte[ArrayUtil.oversize(other.postingsSize, 1)];
    }
    System.arraycopy(other.postings, 0, postings, 0, other.postingsSize);
  } else {
    wrappedTermState.copyFrom(other.wrappedTermState);
  }

  // NOTE: we do not copy the
  // inlinedBytes/inlinedBytesReader; these are only
  // stored on the "primary" TermState.  They are
  // "transient" to cloned term states.
}
项目:NYBC    文件:BlockTreeTermsReader.java   
@Override
public void seekExact(BytesRef target, TermState otherState) {
  // if (DEBUG) {
  //   System.out.println("BTTR.seekExact termState seg=" + segment + " target=" + target.utf8ToString() + " " + target + " state=" + otherState);
  // }
  assert clearEOF();
  if (target.compareTo(term) != 0 || !termExists) {
    assert otherState != null && otherState instanceof BlockTermState;
    currentFrame = staticFrame;
    currentFrame.state.copyFrom(otherState);
    term.copyBytes(target);
    currentFrame.metaDataUpto = currentFrame.getTermBlockOrd();
    assert currentFrame.metaDataUpto > 0;
    validIndexPrefix = 0;
  } else {
    // if (DEBUG) {
    //   System.out.println("  skip seek: already on target state=" + currentFrame.state);
    // }
  }
}
项目:NYBC    文件:Lucene41PostingsReader.java   
@Override
public void copyFrom(TermState _other) {
  super.copyFrom(_other);
  IntBlockTermState other = (IntBlockTermState) _other;
  docStartFP = other.docStartFP;
  posStartFP = other.posStartFP;
  payStartFP = other.payStartFP;
  lastPosBlockOffset = other.lastPosBlockOffset;
  skipOffset = other.skipOffset;
  singletonDocID = other.singletonDocID;

  // Do not copy bytes, bytesReader (else TermState is
  // very heavy, ie drags around the entire block's
  // byte[]).  On seek back, if next() is in fact used
  // (rare!), they will be re-read from disk.
}
项目:NYBC    文件:MultiPhraseQuery.java   
public UnionDocsAndPositionsEnum(Bits liveDocs, AtomicReaderContext context, Term[] terms, Map<Term,TermContext> termContexts, TermsEnum termsEnum) throws IOException {
  List<DocsAndPositionsEnum> docsEnums = new LinkedList<DocsAndPositionsEnum>();
  for (int i = 0; i < terms.length; i++) {
    final Term term = terms[i];
    TermState termState = termContexts.get(term).get(context.ord);
    if (termState == null) {
      // Term doesn't exist in reader
      continue;
    }
    termsEnum.seekExact(term.bytes(), termState);
    DocsAndPositionsEnum postings = termsEnum.docsAndPositions(liveDocs, null, DocsEnum.FLAG_NONE);
    if (postings == null) {
      // term does exist, but has no positions
      throw new IllegalStateException("field \"" + term.field() + "\" was indexed without position data; cannot run PhraseQuery (term=" + term.text() + ")");
    }
    docsEnums.add(postings);
  }

  _queue = new DocsQueue(docsEnums);
  _posList = new IntQueue();
}
项目:incubator-blur    文件:BlockTreeTermsReader.java   
@Override
public void seekExact(BytesRef target, TermState otherState) {
  // if (DEBUG) {
  //   System.out.println("BTTR.seekExact termState seg=" + segment + " target=" + target.utf8ToString() + " " + target + " state=" + otherState);
  // }
  assert clearEOF();
  if (target.compareTo(term) != 0 || !termExists) {
    assert otherState != null && otherState instanceof BlockTermState;
    currentFrame = staticFrame;
    currentFrame.state.copyFrom(otherState);
    term.copyBytes(target);
    currentFrame.metaDataUpto = currentFrame.getTermBlockOrd();
    assert currentFrame.metaDataUpto > 0;
    validIndexPrefix = 0;
  } else {
    // if (DEBUG) {
    //   System.out.println("  skip seek: already on target state=" + currentFrame.state);
    // }
  }
}
项目:read-open-source-code    文件:BlockTreeTermsReader.java   
@Override
public void seekExact(BytesRef target, TermState otherState) {
  // if (DEBUG) {
  //   System.out.println("BTTR.seekExact termState seg=" + segment + " target=" + target.utf8ToString() + " " + target + " state=" + otherState);
  // }
  assert clearEOF();
  if (target.compareTo(term) != 0 || !termExists) {
    assert otherState != null && otherState instanceof BlockTermState;
    currentFrame = staticFrame;
    currentFrame.state.copyFrom(otherState);
    term.copyBytes(target);
    currentFrame.metaDataUpto = currentFrame.getTermBlockOrd();
    assert currentFrame.metaDataUpto > 0;
    validIndexPrefix = 0;
  } else {
    // if (DEBUG) {
    //   System.out.println("  skip seek: already on target state=" + currentFrame.state);
    // }
  }
}
项目:read-open-source-code    文件:MultiPhraseQuery.java   
public UnionDocsAndPositionsEnum(Bits liveDocs, AtomicReaderContext context, Term[] terms, Map<Term,TermContext> termContexts, TermsEnum termsEnum) throws IOException {
  List<DocsAndPositionsEnum> docsEnums = new LinkedList<DocsAndPositionsEnum>();
  for (int i = 0; i < terms.length; i++) {
    final Term term = terms[i];
    TermState termState = termContexts.get(term).get(context.ord);
    if (termState == null) {
      // Term doesn't exist in reader
      continue;
    }
    termsEnum.seekExact(term.bytes(), termState);
    DocsAndPositionsEnum postings = termsEnum.docsAndPositions(liveDocs, null, DocsEnum.FLAG_NONE);
    if (postings == null) {
      // term does exist, but has no positions
      throw new IllegalStateException("field \"" + term.field() + "\" was indexed without position data; cannot run PhraseQuery (term=" + term.text() + ")");
    }
    cost += postings.cost();
    docsEnums.add(postings);
  }

  _queue = new DocsQueue(docsEnums);
  _posList = new IntQueue();
}
项目:read-open-source-code    文件:BlockTreeTermsReader.java   
@Override
public void seekExact(BytesRef target, TermState otherState) {
  // if (DEBUG) {
  //   System.out.println("BTTR.seekExact termState seg=" + segment + " target=" + target.utf8ToString() + " " + target + " state=" + otherState);
  // }
  assert clearEOF();
  if (target.compareTo(term) != 0 || !termExists) {
    assert otherState != null && otherState instanceof BlockTermState;
    currentFrame = staticFrame;
    currentFrame.state.copyFrom(otherState);
    term.copyBytes(target);
    currentFrame.metaDataUpto = currentFrame.getTermBlockOrd();
    assert currentFrame.metaDataUpto > 0;
    validIndexPrefix = 0;
  } else {
    // if (DEBUG) {
    //   System.out.println("  skip seek: already on target state=" + currentFrame.state);
    // }
  }
}
项目:read-open-source-code    文件:MultiPhraseQuery.java   
public UnionDocsAndPositionsEnum(Bits liveDocs, AtomicReaderContext context, Term[] terms, Map<Term,TermContext> termContexts, TermsEnum termsEnum) throws IOException {
  List<DocsAndPositionsEnum> docsEnums = new LinkedList<DocsAndPositionsEnum>();
  for (int i = 0; i < terms.length; i++) {
    final Term term = terms[i];
    TermState termState = termContexts.get(term).get(context.ord);
    if (termState == null) {
      // Term doesn't exist in reader
      continue;
    }
    termsEnum.seekExact(term.bytes(), termState);
    DocsAndPositionsEnum postings = termsEnum.docsAndPositions(liveDocs, null, DocsEnum.FLAG_NONE);
    if (postings == null) {
      // term does exist, but has no positions
      throw new IllegalStateException("field \"" + term.field() + "\" was indexed without position data; cannot run PhraseQuery (term=" + term.text() + ")");
    }
    cost += postings.cost();
    docsEnums.add(postings);
  }

  _queue = new DocsQueue(docsEnums);
  _posList = new IntQueue();
}
项目:read-open-source-code    文件:OrdsSegmentTermsEnum.java   
@Override
public void seekExact(BytesRef target, TermState otherState) {
  // if (DEBUG) {
  //   System.out.println("BTTR.seekExact termState seg=" + segment + " target=" + target.utf8ToString() + " " + target + " state=" + otherState);
  // }
  assert clearEOF();
  if (target.compareTo(term.get()) != 0 || !termExists) {
    assert otherState != null && otherState instanceof BlockTermState;
    BlockTermState blockState = (BlockTermState) otherState;
    currentFrame = staticFrame;
    currentFrame.state.copyFrom(otherState);
    term.copyBytes(target);
    currentFrame.metaDataUpto = currentFrame.getTermBlockOrd();
    currentFrame.termOrd = blockState.ord+1;
    assert currentFrame.metaDataUpto > 0;
    validIndexPrefix = 0;
  } else {
    // if (DEBUG) {
    //   System.out.println("  skip seek: already on target state=" + currentFrame.state);
    // }
  }
  positioned = true;
}
项目:read-open-source-code    文件:SegmentTermsEnum.java   
@Override
public void seekExact(BytesRef target, TermState otherState) {
  // if (DEBUG) {
  //   System.out.println("BTTR.seekExact termState seg=" + segment + " target=" + target.utf8ToString() + " " + target + " state=" + otherState);
  // }
  assert clearEOF();
  if (target.compareTo(term.get()) != 0 || !termExists) {
    assert otherState != null && otherState instanceof BlockTermState;
    currentFrame = staticFrame;
    currentFrame.state.copyFrom(otherState);
    term.copyBytes(target);
    currentFrame.metaDataUpto = currentFrame.getTermBlockOrd();
    assert currentFrame.metaDataUpto > 0;
    validIndexPrefix = 0;
  } else {
    // if (DEBUG) {
    //   System.out.println("  skip seek: already on target state=" + currentFrame.state);
    // }
  }
}
项目:read-open-source-code    文件:IDVersionSegmentTermsEnum.java   
@Override
public void seekExact(BytesRef target, TermState otherState) {
  // if (DEBUG) {
  //   System.out.println("BTTR.seekExact termState seg=" + segment + " target=" + target.utf8ToString() + " " + target + " state=" + otherState);
  // }
  assert clearEOF();
  if (target.compareTo(term.get()) != 0 || !termExists) {
    assert otherState != null && otherState instanceof BlockTermState;
    currentFrame = staticFrame;
    currentFrame.state.copyFrom(otherState);
    term.copyBytes(target);
    currentFrame.metaDataUpto = currentFrame.getTermBlockOrd();
    assert currentFrame.metaDataUpto > 0;
    validIndexPrefix = 0;
  } else {
    // if (DEBUG) {
    //   System.out.println("  skip seek: already on target state=" + currentFrame.state);
    // }
  }
}
项目:read-open-source-code    文件:MultiPhraseQuery.java   
public UnionDocsAndPositionsEnum(Bits liveDocs, AtomicReaderContext context, Term[] terms, Map<Term,TermContext> termContexts, TermsEnum termsEnum) throws IOException {
  List<DocsAndPositionsEnum> docsEnums = new LinkedList<>();
  for (int i = 0; i < terms.length; i++) {
    final Term term = terms[i];
    TermState termState = termContexts.get(term).get(context.ord);
    if (termState == null) {
      // Term doesn't exist in reader
      continue;
    }
    termsEnum.seekExact(term.bytes(), termState);
    DocsAndPositionsEnum postings = termsEnum.docsAndPositions(liveDocs, null, DocsEnum.FLAG_NONE);
    if (postings == null) {
      // term does exist, but has no positions
      throw new IllegalStateException("field \"" + term.field() + "\" was indexed without position data; cannot run PhraseQuery (term=" + term.text() + ")");
    }
    cost += postings.cost();
    docsEnums.add(postings);
  }

  _queue = new DocsQueue(docsEnums);
  _posList = new IntQueue();
}
项目:Maskana-Gestor-de-Conocimiento    文件:PulsingPostingsReader.java   
@Override
public void copyFrom(TermState _other) {
  super.copyFrom(_other);
  PulsingTermState other = (PulsingTermState) _other;
  postingsSize = other.postingsSize;
  if (other.postingsSize != -1) {
    if (postings == null || postings.length < other.postingsSize) {
      postings = new byte[ArrayUtil.oversize(other.postingsSize, 1)];
    }
    System.arraycopy(other.postings, 0, postings, 0, other.postingsSize);
  } else {
    wrappedTermState.copyFrom(other.wrappedTermState);
  }

  // NOTE: we do not copy the
  // inlinedBytes/inlinedBytesReader; these are only
  // stored on the "primary" TermState.  They are
  // "transient" to cloned term states.
}
项目:Maskana-Gestor-de-Conocimiento    文件:BlockTreeTermsReader.java   
@Override
public void seekExact(BytesRef target, TermState otherState) {
  // if (DEBUG) {
  //   System.out.println("BTTR.seekExact termState seg=" + segment + " target=" + target.utf8ToString() + " " + target + " state=" + otherState);
  // }
  assert clearEOF();
  if (target.compareTo(term) != 0 || !termExists) {
    assert otherState != null && otherState instanceof BlockTermState;
    currentFrame = staticFrame;
    currentFrame.state.copyFrom(otherState);
    term.copyBytes(target);
    currentFrame.metaDataUpto = currentFrame.getTermBlockOrd();
    assert currentFrame.metaDataUpto > 0;
    validIndexPrefix = 0;
  } else {
    // if (DEBUG) {
    //   System.out.println("  skip seek: already on target state=" + currentFrame.state);
    // }
  }
}
项目:Maskana-Gestor-de-Conocimiento    文件:Lucene41PostingsReader.java   
@Override
public void copyFrom(TermState _other) {
  super.copyFrom(_other);
  IntBlockTermState other = (IntBlockTermState) _other;
  docStartFP = other.docStartFP;
  posStartFP = other.posStartFP;
  payStartFP = other.payStartFP;
  lastPosBlockOffset = other.lastPosBlockOffset;
  skipOffset = other.skipOffset;
  singletonDocID = other.singletonDocID;

  // Do not copy bytes, bytesReader (else TermState is
  // very heavy, ie drags around the entire block's
  // byte[]).  On seek back, if next() is in fact used
  // (rare!), they will be re-read from disk.
}
项目:Maskana-Gestor-de-Conocimiento    文件:MultiPhraseQuery.java   
public UnionDocsAndPositionsEnum(Bits liveDocs, AtomicReaderContext context, Term[] terms, Map<Term,TermContext> termContexts, TermsEnum termsEnum) throws IOException {
  List<DocsAndPositionsEnum> docsEnums = new LinkedList<DocsAndPositionsEnum>();
  for (int i = 0; i < terms.length; i++) {
    final Term term = terms[i];
    TermState termState = termContexts.get(term).get(context.ord);
    if (termState == null) {
      // Term doesn't exist in reader
      continue;
    }
    termsEnum.seekExact(term.bytes(), termState);
    DocsAndPositionsEnum postings = termsEnum.docsAndPositions(liveDocs, null, DocsEnum.FLAG_NONE);
    if (postings == null) {
      // term does exist, but has no positions
      throw new IllegalStateException("field \"" + term.field() + "\" was indexed without position data; cannot run PhraseQuery (term=" + term.text() + ")");
    }
    cost += postings.cost();
    docsEnums.add(postings);
  }

  _queue = new DocsQueue(docsEnums);
  _posList = new IntQueue();
}
项目:lams    文件:Lucene40PostingsReader.java   
@Override
public void copyFrom(TermState _other) {
  super.copyFrom(_other);
  StandardTermState other = (StandardTermState) _other;
  freqOffset = other.freqOffset;
  proxOffset = other.proxOffset;
  skipOffset = other.skipOffset;
}
项目:lams    文件:SegmentTermsEnum.java   
@Override
public TermState termState() throws IOException {
  assert !eof;
  currentFrame.decodeMetaData();
  TermState ts = currentFrame.state.clone();
  //if (DEBUG) System.out.println("BTTR.termState seg=" + segment + " state=" + ts);
  return ts;
}
项目:lams    文件:BlockTermState.java   
@Override
public void copyFrom(TermState _other) {
  assert _other instanceof BlockTermState : "can not copy from " + _other.getClass().getName();
  BlockTermState other = (BlockTermState) _other;
  super.copyFrom(_other);
  docFreq = other.docFreq;
  totalTermFreq = other.totalTermFreq;
  termBlockOrd = other.termBlockOrd;
  blockFilePointer = other.blockFilePointer;
}
项目:lams    文件:Lucene41PostingsWriter.java   
@Override
public void copyFrom(TermState _other) {
  super.copyFrom(_other);
  IntBlockTermState other = (IntBlockTermState) _other;
  docStartFP = other.docStartFP;
  posStartFP = other.posStartFP;
  payStartFP = other.payStartFP;
  lastPosBlockOffset = other.lastPosBlockOffset;
  skipOffset = other.skipOffset;
  singletonDocID = other.singletonDocID;
}
项目:Elasticsearch    文件:BlendedTermQuery.java   
private static TermContext adjustDF(TermContext ctx, int newDocFreq) {
    // Use a value of ttf that is consistent with the doc freq (ie. gte)
    long newTTF;
    if (ctx.totalTermFreq() < 0) {
        newTTF = -1;
    } else {
        newTTF = Math.max(ctx.totalTermFreq(), newDocFreq);
    }
    List<LeafReaderContext> leaves = ctx.topReaderContext.leaves();
    final int len;
    if (leaves == null) {
        len = 1;
    } else {
        len = leaves.size();
    }
    TermContext newCtx = new TermContext(ctx.topReaderContext);
    for (int i = 0; i < len; ++i) {
        TermState termState = ctx.get(i);
        if (termState == null) {
            continue;
        }
        newCtx.register(termState, i, newDocFreq, newTTF);
        newDocFreq = 0;
        newTTF = 0;
    }
    return newCtx;
}
项目:search    文件:FSTTermsReader.java   
@Override
public void seekExact(BytesRef target, TermState otherState) {
  if (!target.equals(term)) {
    state.copyFrom(otherState);
    term = BytesRef.deepCopyOf(target);
    seekPending = true;
  }
}
项目:search    文件:FSTOrdTermsReader.java   
@Override
public void seekExact(BytesRef target, TermState otherState) {
  if (!target.equals(term)) {
    state.copyFrom(otherState);
    term = BytesRef.deepCopyOf(target);
    seekPending = true;
  }
}
项目:search    文件:OrdsSegmentTermsEnum.java   
@Override
public TermState termState() throws IOException {
  assert !eof;
  currentFrame.decodeMetaData();
  BlockTermState ts = (BlockTermState) currentFrame.state.clone();
  assert currentFrame.termOrd > 0;
  ts.ord = currentFrame.termOrd-1;
  //if (DEBUG) System.out.println("BTTR.termState seg=" + segment + " state=" + ts);
  return ts;
}
项目:search    文件:BlockTermsReader.java   
@Override
public void seekExact(BytesRef target, TermState otherState) {
  //System.out.println("BTR.seekExact termState target=" + target.utf8ToString() + " " + target + " this=" + this);
  assert otherState != null && otherState instanceof BlockTermState;
  assert !doOrd || ((BlockTermState) otherState).ord < numTerms;
  state.copyFrom(otherState);
  seekPending = true;
  indexIsCurrent = false;
  term.copyBytes(target);
}
项目:search    文件:BlockTermsReader.java   
@Override
public TermState termState() throws IOException {
  //System.out.println("BTR.termState this=" + this);
  decodeMetaData();
  TermState ts = state.clone();
  //System.out.println("  return ts=" + ts);
  return ts;
}
项目:search    文件:SepPostingsReader.java   
@Override
public void copyFrom(TermState _other) {
  super.copyFrom(_other);
  SepTermState other = (SepTermState) _other;
  if (docIndex == null) {
    docIndex = other.docIndex.clone();
  } else {
    docIndex.copyFrom(other.docIndex);
  }
  if (other.freqIndex != null) {
    if (freqIndex == null) {
      freqIndex = other.freqIndex.clone();
    } else {
      freqIndex.copyFrom(other.freqIndex);
    }
  } else {
    freqIndex = null;
  }
  if (other.posIndex != null) {
    if (posIndex == null) {
      posIndex = other.posIndex.clone();
    } else {
      posIndex.copyFrom(other.posIndex);
    }
  } else {
    posIndex = null;
  }
  payloadFP = other.payloadFP;
  skipFP = other.skipFP;
}
项目:search    文件:PulsingPostingsReader.java   
@Override
public void copyFrom(TermState _other) {
  super.copyFrom(_other);
  PulsingTermState other = (PulsingTermState) _other;
  postingsSize = other.postingsSize;
  if (other.postingsSize != -1) {
    if (postings == null || postings.length < other.postingsSize) {
      postings = new byte[ArrayUtil.oversize(other.postingsSize, 1)];
    }
    System.arraycopy(other.postings, 0, postings, 0, other.postingsSize);
  } else {
    wrappedTermState.copyFrom(other.wrappedTermState);
  }
}
项目:search    文件:IDVersionSegmentTermsEnum.java   
@Override
public TermState termState() throws IOException {
  assert !eof;
  currentFrame.decodeMetaData();
  TermState ts = currentFrame.state.clone();
  //if (DEBUG) System.out.println("BTTR.termState seg=" + segment + " state=" + ts);
  return ts;
}
项目:search    文件:IDVersionTermState.java   
@Override
public void copyFrom(TermState _other) {
  super.copyFrom(_other);
  IDVersionTermState other = (IDVersionTermState) _other;
  idVersion = other.idVersion;
  docID = other.docID;
}
项目:search    文件:Lucene40PostingsReader.java   
@Override
public void copyFrom(TermState _other) {
  super.copyFrom(_other);
  StandardTermState other = (StandardTermState) _other;
  freqOffset = other.freqOffset;
  proxOffset = other.proxOffset;
  skipOffset = other.skipOffset;
}
项目:search    文件:SegmentTermsEnum.java   
@Override
public TermState termState() throws IOException {
  assert !eof;
  currentFrame.decodeMetaData();
  TermState ts = currentFrame.state.clone();
  //if (DEBUG) System.out.println("BTTR.termState seg=" + segment + " state=" + ts);
  return ts;
}