congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CountRequestBuilder.setTypes
Code IndexAdd Tabnine to your IDE (free)

How to use
setTypes
method
in
org.elasticsearch.action.count.CountRequestBuilder

Best Java code snippets using org.elasticsearch.action.count.CountRequestBuilder.setTypes (Showing top 7 results out of 315)

origin: richardwilly98/elasticsearch-river-mongodb

public static long getIndexCount(Client client, MongoDBRiverDefinition definition) {
  if (client.admin().indices().prepareExists(definition.getIndexName()).get().isExists()) {
    if (definition.isImportAllCollections()) {
      return client.prepareCount(definition.getIndexName()).execute().actionGet().getCount();
    } else {
      if (client.admin().indices().prepareTypesExists(definition.getIndexName()).setTypes(definition.getTypeName()).get()
          .isExists()) {
        return client.prepareCount(definition.getIndexName()).setTypes(definition.getTypeName()).get().getCount();
      }
    }
  }
  return 0;
}
origin: yandex-qatools/embedded-services

protected CountResponse count(String collectionName, QueryBuilder query) {
  return getClient().prepareCount()
      .setTypes(collectionName)
      .setQuery(query)
      .execute()
      .actionGet(initTimeout);
}
origin: ru.yandex.qatools.embed/embedded-services

protected CountResponse count(String collectionName, QueryBuilder query) {
  return getClient().prepareCount()
      .setTypes(collectionName)
      .setQuery(query)
      .execute()
      .actionGet(initTimeout);
}
origin: ujmp/universal-java-matrix-package

public int size() {
  MatchAllQueryBuilder query = QueryBuilders.matchAllQuery();
  CountResponse response = client.prepareCount(index).setTypes(type).setQuery(query).execute().actionGet();
  return MathUtil.longToInt(response.getCount());
}
origin: alien4cloud/alien4cloud

@Override
public <T> long count(Class<T> clazz, QueryBuilder query) {
  String indexName = getIndexForType(clazz);
  String typeName = MappingBuilder.indexTypeFromClass(clazz);
  CountRequestBuilder countRequestBuilder = getClient().prepareCount(indexName).setTypes(typeName);
  if (query != null) {
    countRequestBuilder.setQuery(query);
  }
  return countRequestBuilder.execute().actionGet().getCount();
}
origin: ujmp/universal-java-matrix-package

public int count(String string) {
  QueryBuilder query = QueryBuilders.queryString(string).defaultOperator(Operator.AND);
  CountResponse response = client.prepareCount(index).setTypes(type).setQuery(query).execute().actionGet();
  return MathUtil.longToInt(response.getCount());
}
origin: SpringDataElasticsearchDevs/spring-data-elasticsearch

@Override
public <T> long count(SearchQuery query, Class<T> clazz) {
  ElasticsearchPersistentEntity<T> persistentEntity = getPersistentEntityFor(clazz);
  CountRequestBuilder countRequestBuilder = client.prepareCount(persistentEntity.getIndexName())
      .setTypes(persistentEntity.getIndexType());
  if(query.getQuery() != null){
    countRequestBuilder.setQuery(query.getQuery());
  }
  return countRequestBuilder.execute().actionGet().count();
}
org.elasticsearch.action.countCountRequestBuildersetTypes

Javadoc

The types of documents the query will run against. Defaults to all types.

Popular methods of CountRequestBuilder

  • execute
  • setQuery
  • <init>
  • setIndices
  • beforeExecute
  • get
  • request
  • sourceBuilder

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • setRequestProperty (URLConnection)
  • notifyDataSetChanged (ArrayAdapter)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • JPanel (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now