Package org.apache.lucene.index

Examples of org.apache.lucene.index.TermFreqVector.indexOf()


    float[] allTermScoreVect = getTermScoreVector();
    float[] termScoreVect = new float[allTermScoreVect.length];
    TermFreqVector freqVector = getTermFreqVector();

    for(String term: terms){
      int idx = freqVector.indexOf(term); // does a binary search
      if( idx == -1 ) continue;
      termScoreVect[idx] = allTermScoreVect[idx];
    }

    return termScoreVect;
View Full Code Here


    float[] allTermScoreVect = getTermScoreVector();
    TermFreqVector freqVector = getTermFreqVector();

    if( freqVector == null ) return 0;
   
    int idx = freqVector.indexOf(term); // does a binary search
    if( idx == -1 ) return 0;
    return allTermScoreVect[idx];
  }

  private float[] createTermScoreVector(TermFreqVector vect, IndexReader reader) throws IOException
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.