Examples of terms()


Examples of org.apache.lucene.index.IndexReader.terms()

    // test seek

    Term t = new Term("c", "danny");
    TermEnum aprioriTermEnum = aprioriReader.terms(t);
    TermEnum testTermEnum = testReader.terms(t);

    assertEquals(aprioriTermEnum.term(), testTermEnum.term());

    t = aprioriTermEnum.term();
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.terms()

    }

    // compare term enumeration stepping

    TermEnum aprioriTermEnum = aprioriReader.terms();
    TermEnum testTermEnum = testReader.terms();


    while (true) {

      if (!aprioriTermEnum.next()) {
View Full Code Here

Examples of org.apache.lucene.index.LeafReader.terms()

    @Override
    public AtomicGeoPointFieldData loadDirect(LeafReaderContext context) throws Exception {
        LeafReader reader = context.reader();

        Terms terms = reader.terms(getFieldNames().indexName());
        AtomicGeoPointFieldData data = null;
        // TODO: Use an actual estimator to estimate before loading.
        NonEstimatingEstimator estimator = new NonEstimatingEstimator(breakerService.getBreaker(CircuitBreaker.Name.FIELDDATA));
        if (terms == null) {
            data = AbstractAtomicGeoPointFieldData.empty(reader.maxDoc());
View Full Code Here

Examples of org.apache.lucene.index.MultiReader.terms()

      try
      {
      readers = _zoieSystem.getIndexReaders();
      MultiReader reader = new MultiReader(readers.toArray(new IndexReader[readers.size()]));
        int numDocs = reader.numDocs();
        terms = reader.terms();
        while(terms.next() && queryTerms.size() < 10000)
        {
          Term term = terms.term();
          int docFreq = reader.docFreq(term);
          if(docFreq * 100 >= numDocs) queryTerms.add(term.text());
View Full Code Here

Examples of org.apache.lucene.index.PruningReader.terms()

    PruningReader tfr = new PruningReader(in, stp, tfp);
    Document doc = tfr.document(4);
    // removed stored values?
    assertNull(doc.get("test"));
    // removed postings ?
    TermEnum te = tfr.terms();
    while (te.next()) {
      assertFalse("test".equals(te.term().field()));
    }
    // but vectors should be present !
    TermFreqVector tv = tfr.getTermFreqVector(4, "test");
View Full Code Here

Examples of org.apache.lucene.index.SlowCompositeReaderWrapper.terms()

    RandomIndexWriter w = new RandomIndexWriter(random(), dir);
    createRandomIndex(atLeast(50), w, random().nextLong());
    DirectoryReader reader = w.getReader();
    SlowCompositeReaderWrapper wrapper = new SlowCompositeReaderWrapper(reader);
    String field = "body";
    Terms terms = wrapper.terms(field);
    PriorityQueue<TermAndFreq> lowFreqQueue = new PriorityQueue<CommonTermsQueryTest.TermAndFreq>(
        5) {
     
      @Override
      protected boolean lessThan(TermAndFreq a, TermAndFreq b) {
View Full Code Here

Examples of org.apache.lucene.pruning.PruningReader.terms()

    PruningReader tfr = new PruningReader(in, stp, tfp);
    Document doc = tfr.document(4);
    // removed stored values?
    assertNull(doc.get("test"));
    // removed postings ?
    TermEnum te = tfr.terms();
    while (te.next()) {
      assertFalse("test".equals(te.term().field()));
    }
    // but vectors should be present !
    TermFreqVector tv = tfr.getTermFreqVector(4, "test");
View Full Code Here

Examples of org.elasticsearch.search.dfs.DfsSearchResult.terms()

    }

    @Test public void testDirectDfs() throws Exception {
        DfsSearchResult dfsResult = searchService.executeDfsPhase(searchRequest(searchSource().query(termQuery("name", "test1")), SearchType.DFS_QUERY_THEN_FETCH));

        assertThat(dfsResult.terms().length, equalTo(1));
        assertThat(dfsResult.freqs().length, equalTo(1));
        assertThat(dfsResult.terms()[0].field(), equalTo("name"));
        assertThat(dfsResult.terms()[0].text(), equalTo("test1"));
        assertThat(dfsResult.freqs()[0], equalTo(1));
    }
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.