/** * @return Returns the value associated with the given key or the default value * for the key type, if the key is not associated with any value. * <p> * <b>Important note:</b> For primitive type values, the value returned for a non-existing * key may not be the default value of the primitive type (it may be any value previously * assigned to that slot). */ public VType get(KType key) { return map.get(key); }
@Override public VType get(KType key) { return map.get(key); }
private long getDocCount(String fieldName, Terms topLevelTerms) throws IOException { if (dfs != null) { return dfs.fieldStatistics().get(fieldName).docCount(); } return topLevelTerms.getDocCount(); }
@Override public CollectionStatistics collectionStatistics(String field) throws IOException { if (aggregatedDfs == null) { // we are either executing the dfs phase or the search_type doesn't include the dfs phase. return super.collectionStatistics(field); } CollectionStatistics collectionStatistics = aggregatedDfs.fieldStatistics().get(field); if (collectionStatistics == null) { // we don't have stats for this - this might be a must_not clauses etc. that doesn't allow extract terms on the query return super.collectionStatistics(field); } return collectionStatistics; }
/** * Return true if all keys of some other container exist in this container. * Equality comparison is performed with this object's {@link #equals(Object, Object)} * method. * Values are compared using {@link Objects#equals(Object)} method. */ protected boolean equalElements(ObjectObjectHashMap<?, ?> other) { if (other.size() != size()) { return false; } for (ObjectObjectCursor<?, ?> c : other) { KType key = (KType) c.key; if (!containsKey(key) || !java.util.Objects.equals(get(key), c.value)) { return false; } } return true; }
@Override public TermStatistics termStatistics(Term term, TermContext context) throws IOException { if (aggregatedDfs == null) { // we are either executing the dfs phase or the search_type doesn't include the dfs phase. return super.termStatistics(term, context); } TermStatistics termStatistics = aggregatedDfs.termStatistics().get(term); if (termStatistics == null) { // we don't have stats for this - this might be a must_not clauses etc. that doesn't allow extract terms on the query return super.termStatistics(term, context); } return termStatistics; }
private TermStatistics getTermStatistics(TermsEnum termsEnum, Term term) throws IOException { if (dfs != null) { return dfs.termStatistics().get(term); } return new TermStatistics(termsEnum.term(), termsEnum.docFreq(), termsEnum.totalTermFreq()); }
/** * @return Returns the value associated with the given key or the default value * for the key type, if the key is not associated with any value. * <p> * <b>Important note:</b> For primitive type values, the value returned for a non-existing * key may not be the default value of the primitive type (it may be any value previously * assigned to that slot). */ public VType get(KType key) { return map.get(key); }
/** * @return Returns the value associated with the given key or the default value * for the key type, if the key is not associated with any value. * <p> * <b>Important note:</b> For primitive type values, the value returned for a non-existing * key may not be the default value of the primitive type (it may be any value previously * assigned to that slot). */ public VType get(KType key) { return map.get(key); }
/** * @return Returns the value associated with the given key or the default value * for the key type, if the key is not associated with any value. * <p> * <b>Important note:</b> For primitive type values, the value returned for a non-existing * key may not be the default value of the primitive type (it may be any value previously * assigned to that slot). */ public VType get(KType key) { return map.get(key); }
@SuppressWarnings("unchecked") @Override public final synchronized <V> V getFromContext(Object key) { return context != null ? (V) context.get(key) : null; }
@Override public VType get(KType key) { return map.get(key); }
for (int i = 0; i < terms.length; i++) { assert terms[i] != null; TermStatistics existing = termStatistics.get(terms[i]); if (existing != null) { assert terms[i].bytes().equals(existing.term()); CollectionStatistics value = (CollectionStatistics) values[i]; assert key != null; CollectionStatistics existing = fieldStatistics.get(key); if (existing != null) { CollectionStatistics merged = new CollectionStatistics(
private long getDocCount(String fieldName, Terms topLevelTerms) throws IOException { if (dfs != null) { return dfs.fieldStatistics().get(fieldName).docCount(); } return topLevelTerms.getDocCount(); }
ShardStats indexShardStats = countsPerIndex.get(shardStats.getShardRouting().getIndexName()); if (indexShardStats == null) { indexShardStats = new ShardStats();
private long getDocCount(String fieldName, Terms topLevelTerms) throws IOException { if (dfs != null) { return dfs.fieldStatistics().get(fieldName).docCount(); } return topLevelTerms.getDocCount(); }
@Override public TermStatistics termStatistics(Term term, TermContext context) throws IOException { if (aggregatedDfs == null) { // we are either executing the dfs phase or the search_type doesn't include the dfs phase. return super.termStatistics(term, context); } TermStatistics termStatistics = aggregatedDfs.termStatistics().get(term); if (termStatistics == null) { // we don't have stats for this - this might be a must_not clauses etc. that doesn't allow extract terms on the query return super.termStatistics(term, context); } return termStatistics; }
@Override public CollectionStatistics collectionStatistics(String field) throws IOException { if (aggregatedDfs == null) { // we are either executing the dfs phase or the search_type doesn't include the dfs phase. return super.collectionStatistics(field); } CollectionStatistics collectionStatistics = aggregatedDfs.fieldStatistics().get(field); if (collectionStatistics == null) { // we don't have stats for this - this might be a must_not clauses etc. that doesn't allow extract terms on the query return super.collectionStatistics(field); } return collectionStatistics; }
private TermStatistics getTermStatistics(TermsEnum termsEnum, Term term) throws IOException { if (dfs != null) { return dfs.termStatistics().get(term); } return new TermStatistics(termsEnum.term(), termsEnum.docFreq(), termsEnum.totalTermFreq()); }