Package org.apache.lucene.search.Explanation

Examples of org.apache.lucene.search.Explanation.IDFExplanation


    @Override public float tf(float freq) { return freq; }
    @Override public float sloppyFreq(int distance) { return 2.0f; }
    @Override public float idf(int docFreq, int numDocs) { return 1.0f; }
    @Override public float coord(int overlap, int maxOverlap) { return 1.0f; }
    @Override public IDFExplanation idfExplain(Collection<Term> terms, Searcher searcher) throws IOException {
      return new IDFExplanation() {
        @Override
        public float getIdf() {
          return 1.0f;
        }
        @Override
View Full Code Here


      return 1.0f;
    }
   
    // idf used for phrase queries
    @Override public IDFExplanation idfExplain(Collection<Term> terms, Searcher searcher) throws IOException {
      return new IDFExplanation() {
        @Override
        public float getIdf() {
          return 1.0f;
        }
        @Override
View Full Code Here

   */
  public IDFExplanation idfExplain(final Term term, final Searcher searcher) throws IOException {
    final int df = searcher.docFreq(term);
    final int max = searcher.maxDoc();
    final float idf = idf(df, max);
    return new IDFExplanation() {
        @Override
        public String explain() {
          return "idf(docFreq=" + df +
          ", maxDocs=" + max + ")";
        }
View Full Code Here

      exp.append(term.text());
      exp.append("=");
      exp.append(df);
    }
    final float fIdf = idf;
    return new IDFExplanation() {
      @Override
      public float getIdf() {
        return fIdf;
      }
      @Override
View Full Code Here

    @Override public float tf(float freq) { return freq; }
    @Override public float sloppyFreq(int distance) { return 2.0f; }
    @Override public float idf(int docFreq, int numDocs) { return 1.0f; }
    @Override public float coord(int overlap, int maxOverlap) { return 1.0f; }
    @Override public IDFExplanation idfExplain(Collection<Term> terms, Searcher searcher) throws IOException {
      return new IDFExplanation() {
        @Override
        public float getIdf() {
          return 1.0f;
        }
        @Override
View Full Code Here

    @Override public float tf(float freq) { return freq; }
    @Override public float sloppyFreq(int distance) { return 2.0f; }
    @Override public float idf(int docFreq, int numDocs) { return 1.0f; }
    @Override public float coord(int overlap, int maxOverlap) { return 1.0f; }
    @Override public IDFExplanation idfExplain(Collection<Term> terms, Searcher searcher) throws IOException {
      return new IDFExplanation() {
        @Override
        public float getIdf() {
          return 1.0f;
        }
        @Override
View Full Code Here

    @Override public float tf(float freq) {
      return 1.0f;
    }
    // idf used for phrase queries
    @Override public IDFExplanation idfExplain(Collection<Term> terms, Searcher searcher) throws IOException {
      return new IDFExplanation() {
        @Override
        public float getIdf() {
          return 1.0f;
        }
        @Override
View Full Code Here

    @Override public float tf(float freq) { return freq; }
    @Override public float sloppyFreq(int distance) { return 2.0f; }
    @Override public float idf(int docFreq, int numDocs) { return 1.0f; }
    @Override public float coord(int overlap, int maxOverlap) { return 1.0f; }
    @Override public IDFExplanation idfExplain(Collection<Term> terms, Searcher searcher) throws IOException {
      return new IDFExplanation() {
        @Override
        public float getIdf() {
          return 1.0f;
        }
        @Override
View Full Code Here

    searcher.setSimilarity(new DefaultSimilarity() {
     
      @Override
      public IDFExplanation idfExplain(Collection<Term> terms,
          Searcher searcher) throws IOException {
        return new IDFExplanation() {

          @Override
          public float getIdf() {
            return 10f;
          }
View Full Code Here

    searcher.setSimilarity(new DefaultSimilarity() {
     
      @Override
      public IDFExplanation idfExplain(Collection<Term> terms,
          Searcher searcher) throws IOException {
        return new IDFExplanation() {

          @Override
          public float getIdf() {
            return 10f;
          }
View Full Code Here

TOP

Related Classes of org.apache.lucene.search.Explanation.IDFExplanation

Copyright © 2018 www.massapicom. 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.