Package org.apache.lucene.search

Examples of org.apache.lucene.search.Explanation


       * {@inheritDoc}
       */
      @Override
      public Explanation explain(IndexReader reader, int doc) throws IOException
      {
         return new Explanation();
      }
View Full Code Here


      }
    }
  }

  public Explanation explain(int documentId) {
    Explanation explanation = null;
    SearchFactoryImplementor searchFactoryImplementor = getSearchFactoryImplementor();
    Searcher searcher = buildSearcher( searchFactoryImplementor );
    if (searcher == null) {
      throw new SearchException("Unable to build explanation for document id:"
          + documentId + ". no index found");
View Full Code Here

      Query luceneQuery = queryParser.parse("Eats");
      CacheQuery cacheQuery = Search.getSearchManager(cache).getQuery(luceneQuery);

      int matchCounter = 0;
      for(int i = 0; i < 4; i++) {
         Explanation found = cacheQuery.explain(i);

         if(found.isMatch())
            matchCounter++;
      }

      AssertJUnit.assertEquals(3, matchCounter);
   }
View Full Code Here

      }
    }
  }

  public Explanation explain(int documentId) {
    Explanation explanation = null;
    Searcher searcher = buildSearcher( searchFactoryImplementor );
    if ( searcher == null ) {
      throw new SearchException(
          "Unable to build explanation for document id:"
              + documentId + ". no index found"
View Full Code Here

          doc.add(new Field("id", hits[i].doc + "", Field.Store.YES, Field.Index.NO));
          log.debug("adding contentid: " + doc.getField("contentid"));
          log.debug("with hits[" + i + "].score = " + hits[i].score);
          result.put(doc, hits[i].score);
          if (explain) {
            Explanation ex = searcher.explain(parsedQuery, hits[i].doc);
            log_explain.debug("Explanation for " + doc.toString() + " - " + ex.toString());
          }
        } else {
          log.error("Loading search documents failed partly (document has MAX_INTEGER as document id");
        }
      }
View Full Code Here

        /**
         * {@inheritDoc}
         */
        public Explanation explain(IndexReader reader, int doc) throws IOException {
            return new Explanation();
        }
View Full Code Here

        /**
         * Returns an empty Explanation object.
         * @return an empty Explanation object.
         */
        public Explanation explain(int doc) {
            return new Explanation();
        }
View Full Code Here

        super(Similarity.getDefault());
        this.reader = reader;
        this.weight = weight;
        this.field = field;
        matchExpl
                = new Explanation(Similarity.getDefault().idf(reader.maxDoc(),
                        reader.maxDoc()),
                        "matchAll");
        calculateDocFilter();
    }
View Full Code Here

        /**
         * {@inheritDoc}
         */
        public Explanation explain(IndexReader reader, int doc) throws IOException {
            return new Explanation();
        }
View Full Code Here

        /**
         * {@inheritDoc}
         */
        public Explanation explain(IndexReader reader, int doc) throws IOException {
            return new Explanation();
        }
View Full Code Here

TOP

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

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.