Examples of CollectionStatistics


Examples of org.apache.lucene.search.CollectionStatistics

    stats.setTotalTermFreq(TOTAL_TERM_FREQ);
    return stats;
  }
 
  private CollectionStatistics toCollectionStats(BasicStats stats) {
    return new CollectionStatistics(stats.field, stats.getNumberOfDocuments(), -1, stats.getNumberOfFieldTokens(), -1);
  }
View Full Code Here

Examples of org.apache.lucene.search.CollectionStatistics

    stats.setTotalTermFreq(TOTAL_TERM_FREQ);
    return stats;
  }
 
  private CollectionStatistics toCollectionStats(BasicStats stats) {
    return new CollectionStatistics(stats.field, stats.getNumberOfDocuments(), -1, stats.getNumberOfFieldTokens(), -1);
  }
View Full Code Here

Examples of org.apache.lucene.search.CollectionStatistics

    stats.setTotalTermFreq(TOTAL_TERM_FREQ);
    return stats;
  }
 
  private CollectionStatistics toCollectionStats(BasicStats stats) {
    return new CollectionStatistics(stats.field, stats.getNumberOfDocuments(), -1, stats.getNumberOfFieldTokens(), -1);
  }
View Full Code Here

Examples of org.apache.lucene.search.CollectionStatistics

  private LuceneIndexHelper() {

  }

  public static void fieldShouldExistInIndex(IndexSearcher searcher, String field) throws IOException {
    CollectionStatistics idFieldStatistics = searcher.collectionStatistics(field);
    if (idFieldStatistics.docCount() == 0) {
      throw new IllegalArgumentException("Field '" + field + "' does not exist in the index");
    }
  }
View Full Code Here

Examples of org.apache.lucene.search.CollectionStatistics

            ObjectObjectOpenHashMap<String, CollectionStatistics> fieldStatistics = HppcMaps.newNoNullKeysMap();
            for (Term term : terms) {
                assert term.field() != null : "field is null";
                if (!fieldStatistics.containsKey(term.field())) {
                    final CollectionStatistics collectionStatistics = context.searcher().collectionStatistics(term.field());
                    fieldStatistics.put(term.field(), collectionStatistics);
                }
            }

            context.dfsResult().termsStatistics(terms, termStatistics)
View Full Code Here

Examples of org.apache.lucene.search.CollectionStatistics

        Object[] keys = fieldStatistics.keys;
        Object[] values = fieldStatistics.values;
        for (int i = 0; i < states.length; i++) {
            if (states[i]) {
                out.writeString((String) keys[i]);
                CollectionStatistics statistics = (CollectionStatistics) values[i];
                assert statistics.maxDoc() >= 0;
                out.writeVLong(statistics.maxDoc());
                out.writeVLong(addOne(statistics.docCount()));
                out.writeVLong(addOne(statistics.sumTotalTermFreq()));
                out.writeVLong(addOne(statistics.sumDocFreq()));
            }
        }
    }
View Full Code Here

Examples of org.apache.lucene.search.CollectionStatistics

            assert field != null;
            final long maxDoc = in.readVLong();
            final long docCount = subOne(in.readVLong());
            final long sumTotalTermFreq = subOne(in.readVLong());
            final long sumDocFreq = subOne(in.readVLong());
            CollectionStatistics stats = new CollectionStatistics(field, maxDoc, docCount, sumTotalTermFreq, sumDocFreq);
            fieldStatistics.put(field, stats);
        }
        return fieldStatistics;
    }
View Full Code Here

Examples of org.hibernate.stat.CollectionStatistics

        this.persistenceUnitRegistry = persistenceUnitRegistry;
    }

    @Override
    protected void executeRuntimeStep(OperationContext context, ModelNode operation) throws OperationFailedException {
        CollectionStatistics statistics = collectionStatistics(operation);
        if (statistics != null) {
            handle(statistics, context, operation.require(ModelDescriptionConstants.NAME).asString());
        }
        context.completeStep();
    }
View Full Code Here

Examples of org.hibernate.stat.CollectionStatistics

    child.setParent( parent );
    session.save( parent );
    session.getTransaction().commit();
    session.close();

    CollectionStatistics stats =  sfi().getStatistics().getCollectionStatistics( Parent.class.getName() + ".children" );
    long recreateCount = stats.getRecreateCount();
    long updateCount = stats.getUpdateCount();

    session = openSession();
    session.beginTransaction();
    parent = ( Parent ) session.merge( parent );
    session.getTransaction().commit();
    session.close();

    assertEquals( 1, parent.getChildren().size() );
    assertEquals( recreateCount, stats.getRecreateCount() );
    assertEquals( updateCount, stats.getUpdateCount() );

    session = openSession();
    session.beginTransaction();
    parent = ( Parent ) session.get( Parent.class, "p1" );
    assertEquals( 1, parent.getChildren().size() );
View Full Code Here

Examples of org.hibernate.stat.CollectionStatistics

    child.setParent( parent );
    session.save( parent );
    session.getTransaction().commit();
    session.close();

    CollectionStatistics stats =  sfi().getStatistics().getCollectionStatistics( Parent.class.getName() + ".children" );
    long recreateCount = stats.getRecreateCount();
    long updateCount = stats.getUpdateCount();

    session = openSession();
    session.beginTransaction();
    parent = ( Parent ) session.get( Parent.class, "p1" );
    assertEquals( 1, parent.getChildren().size() );
    session.getTransaction().commit();
    session.close();

    assertEquals( 1, parent.getChildren().size() );
    assertEquals( recreateCount, stats.getRecreateCount() );
    assertEquals( updateCount, stats.getUpdateCount() );

    session = openSession();
    session.beginTransaction();
    assertEquals( 1, parent.getChildren().size() );
    session.delete( parent );
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.