Package org.apache.lucene.search.similarities

Examples of org.apache.lucene.search.similarities.DefaultSimilarity


        try {
          // a little hackish, QueryUtils.check is too costly to do on bigSearcher in this loop.
          searcher.setSimilarity(bigSearcher.getSimilarity()); // random sim
          QueryUtils.check(random(), q1, searcher);
        } finally {
          searcher.setSimilarity(new DefaultSimilarity()); // restore
        }

        TopFieldCollector collector = TopFieldCollector.create(sort, 1000,
            false, true, true, true);
View Full Code Here


  /**
   * Constructor requiring an IndexReader.
   */
  public MoreLikeThis(IndexReader ir) {
    this(ir, new DefaultSimilarity());
  }
View Full Code Here

    restoreProperties.put("user.timezone", System.getProperty("user.timezone"));
    savedTimeZone = TimeZone.getDefault();
    TimeZone randomTimeZone = randomTimeZone(random());
    timeZone = testTimeZone.equals("random") ? randomTimeZone : TimeZone.getTimeZone(testTimeZone);
    TimeZone.setDefault(timeZone);
    similarity = random().nextBoolean() ? new DefaultSimilarity() : new RandomSimilarityProvider(random());

    // Check codec restrictions once at class level.
    try {
      checkCodecRestrictions(codec);
    } catch (AssumptionViolatedException e) {
View Full Code Here

      };
    } else {
      _interpreter = interpreter;
    }
    _analyzer = analyzer == null ? new StandardAnalyzer(Version.LUCENE_43) : analyzer;
    _similarity = similarity == null ? new DefaultSimilarity() : similarity;
    log.info("creating Zoie instance --> " + _dirMgr.toString() + "\t" + _interpreter.toString()
        + "\t" + (indexReaderDecorator != null ? indexReaderDecorator.toString() : "null") + "\t"
        + docIdMapperFactory.toString() + "\t" + "Analyzer: " + _analyzer.toString()
        + "\tSimilarity: " + _similarity.toString()
        + "\tbatchSize (desired max batch size for indexing to RAM): " + batchSize
View Full Code Here

  @Deprecated
  public static <D> ZoieSystem<IndexReader, D> buildDefaultInstance(File idxDir,
      ZoieIndexableInterpreter<D> interpreter, int batchSize, long batchDelay, boolean realtime,
      Comparator<String> versionComparator) {
    return buildDefaultInstance(idxDir, interpreter, new StandardAnalyzer(Version.LUCENE_43),
      new DefaultSimilarity(), batchSize, batchDelay, realtime, versionComparator);
  }
View Full Code Here

  public void setAnalyzer(Analyzer analyzer) {
    this.analyzer = analyzer;
  }

  public Similarity getSimilarity() {
    return similarity == null ? new DefaultSimilarity() : similarity;
  }
View Full Code Here

        }
        return terms;
    }

    public IndexSearcher setSimilarity(IndexSearcher searcher) {
        Similarity similarity = random().nextBoolean() ? new BM25Similarity() : new DefaultSimilarity();
        searcher.setSimilarity(similarity);
        return searcher;
    }
View Full Code Here

    /**
     * Constructor requiring an IndexReader.
     */
    public XMoreLikeThis(IndexReader ir) {
        this(ir, new DefaultSimilarity());
    }
View Full Code Here

        return true;
    }

    @Override
    public Query rewrite(IndexReader reader) throws IOException {
        XMoreLikeThis mlt = new XMoreLikeThis(reader, similarity == null ? new DefaultSimilarity() : similarity);

        mlt.setFieldNames(moreLikeFields);
        mlt.setAnalyzer(analyzer);
        mlt.setMinTermFreq(minTermFrequency);
        mlt.setMinDocFreq(minDocFreq);
View Full Code Here

TOP

Related Classes of org.apache.lucene.search.similarities.DefaultSimilarity

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.