Package org.apache.lucene.index

Examples of org.apache.lucene.index.TermPositions.skipTo()


    // Read the new part of the parents array from the positions:
    TermPositions positions = indexReader.termPositions(
        new Term(Consts.FIELD_PAYLOADS, Consts.PAYLOAD_PARENT));
    try {
      if (!positions.skipTo(first) && first < num) {
        throw new CorruptIndexException("Missing parent data for category " + first);
      }
      for (int i=first; i<num; i++) {
        // Note that we know positions.doc() >= i (this is an
        // invariant kept throughout this loop)
View Full Code Here


          private ScoredMatch match = new ScoredMatch(0, new DocId(data, 0, 0));
        @Override
        public ScoredMatch apply(RawMatch rawMatch) {
          int rawId = rawMatch.getRawId();
          try {
            if (payloads.skipTo(rawId) && payloads.doc() == rawId) {
              payloads.nextPosition();
              int size = payloads.getPayloadLength();
              if (size > data.length) {
                  data = new byte[size];
              }
View Full Code Here

    // Read the new part of the parents array from the positions:
    TermPositions positions = indexReader.termPositions(
        new Term(Consts.FIELD_PAYLOADS, Consts.PAYLOAD_PARENT));
    try {
      if (!positions.skipTo(first) && first < num) {
        throw new CorruptIndexException("Missing parent data for category " + first);
      }
      for (int i=first; i<num; i++) {
        // Note that we know positions.doc() >= i (this is an
        // invariant kept throughout this loop)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.