Examples of TermPositionVector


Examples of org.apache.lucene.index.TermPositionVector

      if (document == null) {
        continue; // deleted
      }
      for (Fieldable field : document.getDocument().getFields()) {
        if (field.isTermVectorStored() && field.isStoreOffsetWithTermVector()) {
          TermPositionVector termPositionVector = (TermPositionVector) sourceIndexReader.getTermFreqVector(document.getDocumentNumber(), field.name());
          if (termPositionVector != null) {
            for (int i = 0; i < termPositionVector.getTerms().length; i++) {
              String token = termPositionVector.getTerms()[i];
              InstantiatedTerm term = findTerm(field.name(), token);
              InstantiatedTermDocumentInformation termDocumentInformation = term.getAssociatedDocument(document.getDocumentNumber());
              termDocumentInformation.setTermOffsets(termPositionVector.getOffsets(i));
            }
          }
        }
      }
    }
View Full Code Here

Examples of org.apache.lucene.index.TermPositionVector

        throw new IllegalArgumentException(field+" in doc #"+docId
                  +"does not have any term position data stored");
    }
      if(tfv instanceof TermPositionVector)
      {
      TermPositionVector tpv=(TermPositionVector) reader.getTermFreqVector(docId,field);
          return getTokenStream(tpv);         
      }
      throw new IllegalArgumentException(field+" in doc #"+docId
              +"does not have any term position data stored");
    }
View Full Code Here

Examples of org.apache.lucene.index.TermPositionVector

      if (DEBUG) System.err.println("MemoryIndexReader.getTermFreqVector");
      final Info info = getInfo(fieldName);
      if (info == null) return null; // TODO: or return empty vector impl???
      info.sortTerms();
     
      return new TermPositionVector() {
 
        private final Map.Entry<String,ArrayIntList>[] sortedTerms = info.sortedTerms;
       
        public String getField() {
          return fieldName;
View Full Code Here

Examples of org.apache.lucene.index.TermPositionVector

        throw new IllegalArgumentException(field+" in doc #"+docId
                  +"does not have any term position data stored");
    }
      if(tfv instanceof TermPositionVector)
      {
      TermPositionVector tpv=(TermPositionVector) reader.getTermFreqVector(docId,field);
          return getTokenStream(tpv);         
      }
      throw new IllegalArgumentException(field+" in doc #"+docId
              +"does not have any term position data stored");
    }
View Full Code Here

Examples of org.apache.lucene.index.TermPositionVector

      if (document == null) {
        continue; // deleted
      }
      for (Field field : (List<Field>) document.getDocument().getFields()) {
        if (field.isTermVectorStored() && field.isStoreOffsetWithTermVector()) {
          TermPositionVector termPositionVector = (TermPositionVector) sourceIndexReader.getTermFreqVector(document.getDocumentNumber(), field.name());
          if (termPositionVector != null) {
            for (int i = 0; i < termPositionVector.getTerms().length; i++) {
              String token = termPositionVector.getTerms()[i];
              InstantiatedTerm term = findTerm(field.name(), token);
              InstantiatedTermDocumentInformation termDocumentInformation = term.getAssociatedDocument(document.getDocumentNumber());
              termDocumentInformation.setTermOffsets(termPositionVector.getOffsets(i));
            }
          }
        }
      }
    }
View Full Code Here

Examples of org.apache.lucene.index.TermPositionVector

      if (DEBUG) System.err.println("MemoryIndexReader.getTermFreqVector");
      final Info info = getInfo(fieldName);
      if (info == null) return null; // TODO: or return empty vector impl???
      info.sortTerms();
     
      return new TermPositionVector() {
 
        private final Map.Entry[] sortedTerms = info.sortedTerms;
       
        public String getField() {
          return fieldName;
View Full Code Here

Examples of org.apache.lucene.index.TermPositionVector

      if (DEBUG) System.err.println("MemoryIndexReader.getTermFreqVector");
      final Info info = getInfo(fieldName);
      if (info == null) return null; // TODO: or return empty vector impl???
      info.sortTerms();
     
      return new TermPositionVector() {
 
        private final Map.Entry<String,ArrayIntList>[] sortedTerms = info.sortedTerms;
       
        public String getField() {
          return fieldName;
View Full Code Here

Examples of org.apache.lucene.index.TermPositionVector

         {
            LOG.trace("An exception occurred: " + e.getMessage());
         }
      }

      return new TermPositionVector()
      {

         private String[] terms = (String[])termMap.keySet().toArray(new String[termMap.size()]);

         public int[] getTermPositions(int index)
View Full Code Here

Examples of org.apache.lucene.index.TermPositionVector

            }
        } catch (IOException e) {
            // should never happen, we are reading from a string
        }

        return new TermPositionVector() {

            private String[] terms =
                    (String[]) termMap.keySet().toArray(new String[termMap.size()]);

            public int[] getTermPositions(int index) {
View Full Code Here

Examples of org.apache.lucene.index.TermPositionVector

            }
        } catch (IOException e) {
            // should never happen, we are reading from a string
        }

        return new TermPositionVector() {

            private String[] terms =
                    (String[]) termMap.keySet().toArray(new String[termMap.size()]);

            public int[] getTermPositions(int index) {
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.