Package org.elasticsearch.index.query

Examples of org.elasticsearch.index.query.QueryBuilder


   * <br>see http://www.elasticsearch.org/guide/reference/query-dsl/range-query.html
   *
   */
  @Test
  public void rangeSearch() throws Exception {
    QueryBuilder qb = null;
    // TODO create the query

    logger.info("Your query is : {}", qb);

    // TODO Execute the query
View Full Code Here


   * <br>see http://www.elasticsearch.org/guide/reference/query-dsl/range-query.html
   * @see http://www.elasticsearch.org/guide/reference/query-dsl/bool-query.html
   */
  @Test
  public void bool_text_and_range_Search() throws Exception {
    QueryBuilder qb = null;
    // TODO create the query

    logger.info("Your query is : {}", qb);

    // TODO Execute the query
View Full Code Here

   * <br>see http://www.elasticsearch.org/guide/reference/query-dsl/range-query.html
   * <br>see http://www.elasticsearch.org/guide/reference/query-dsl/bool-query.html
   */
  @Test
  public void query_and_filter_Search() throws Exception {
    QueryBuilder query = null;
    // TODO create the query
   
    FilterBuilder filter = null;
    // TODO create the filter

    QueryBuilder qb = null;
    // TODO create the filtered Query

    logger.info("Your query is : {}", qb);

    // TODO Execute the query
View Full Code Here

   * <br>see http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query.html
   * <br>see http://www.elasticsearch.org/guide/reference/api/search/from-size.html
   */
  @Test
  public void google_Search() throws Exception {
    QueryBuilder qb = null;
    // TODO create the filtered Query

    logger.info("Your query is : {}", qb);

    // TODO Execute the query and get the 100 first results
View Full Code Here

   * <br>see http://www.elasticsearch.org/guide/reference/api/search/from-size.html
   * <br>see http://www.elasticsearch.org/guide/reference/api/search/highlighting.html
   */
  @Test
  public void google_with_boost_Search() throws Exception {
    QueryBuilder qb = null;
    // TODO create the filtered Query

    logger.info("Your query is : {}", qb);

    // TODO Execute the query, get the 100 first results and highlight brand and colour fields
View Full Code Here

   * <br>see http://www.elasticsearch.org/guide/reference/java-api/query-dsl.html
   * <br>see http://www.elasticsearch.org/guide/reference/query-dsl/fuzzy-query.html
   */
  @Test
  public void fuzzySearch() throws Exception {
    QueryBuilder qb = null;
    // TODO create the query
   
    logger.info("Your query is : {}", qb);

    // TODO Execute the query
View Full Code Here

                srb.addSort(e.getKey(), SortOrder.ASC);
            else if ("desc".equals(e.getValue()))
                srb.addSort(e.getKey(), SortOrder.DESC);
        }

        QueryBuilder qb = createQuery(getQuery());
        qb = processFilterQueries(qb);
        processFacetFields(srb);
        processFacetQueries(srb);
        srb.setQuery(qb);
View Full Code Here

        return (TweetQuery) super.createFriendsQuery("user", friends);
    }

    @Override
    protected QueryBuilder createQuery(String queryStr) {
        QueryBuilder qb;
        if (queryStr == null || queryStr.isEmpty())
            qb = QueryBuilders.matchAllQuery();
        else {
            // fields can also contain patterns like so name.* to match more fields
            qb = QueryBuilders.queryString(queryStr).defaultOperator(Operator.AND).
View Full Code Here

        return (UserQuery) addFacetField("tag").addFacetField("lang");
    }
       
    @Override
    protected QueryBuilder createQuery(String queryStr) {
        QueryBuilder qb;
        if (queryStr == null || queryStr.isEmpty())
            qb = QueryBuilders.matchAllQuery();
        else {
            // fields can also contain patterns like so name.* to match more fields
            return QueryBuilders.queryString(smartEscapeQuery(queryStr)).
View Full Code Here

import org.elasticsearch.index.query.TermFilterBuilder;

class DeleteQueryBuilder {

    public String unsupportedProjectEntriesQuery(String projectId, List<String> supportedVersions) {
        QueryBuilder query = QueryBuilders.matchAllQuery();

        OrFilterBuilder supportedVersionsFilter = matchSupportedVersions(supportedVersions);
        NotFilterBuilder notSupportedVersionFilter = new NotFilterBuilder(supportedVersionsFilter);

        TermFilterBuilder projectFilter = new TermFilterBuilder("projectId", projectId);
View Full Code Here

TOP

Related Classes of org.elasticsearch.index.query.QueryBuilder

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.