Examples of must()


Examples of org.elasticsearch.index.query.BoolQueryBuilder.must()

       
        ElasticSearchManager esm = ElasticSearchManager.getIndex(sb.toString());
               
        SearchRequestBuilder searchOptions = esm.getSearchOptions();
        BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
        boolQuery.must(QueryBuilders.rangeQuery(DocumentPojo.created_).from(cleanseStartTime));
        boolQuery.must(QueryBuilders.termQuery(DocumentPojo.sourceKey_, sp.getKey() ));
        searchOptions.setSize(200); // (note this is multiplied by the number of primary shards)
        searchOptions.setSearchType(SearchType.SCAN);
        searchOptions.setScroll("10m");
        SearchResponse rsp = esm.doQuery(boolQuery, searchOptions);
View Full Code Here

Examples of org.elasticsearch.index.query.BoolQueryBuilder.must()

        ElasticSearchManager esm = ElasticSearchManager.getIndex(sb.toString());
               
        SearchRequestBuilder searchOptions = esm.getSearchOptions();
        BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
        boolQuery.must(QueryBuilders.rangeQuery(DocumentPojo.created_).from(cleanseStartTime));
        boolQuery.must(QueryBuilders.termQuery(DocumentPojo.sourceKey_, sp.getKey() ));
        searchOptions.setSize(200); // (note this is multiplied by the number of primary shards)
        searchOptions.setSearchType(SearchType.SCAN);
        searchOptions.setScroll("10m");
        SearchResponse rsp = esm.doQuery(boolQuery, searchOptions);
        String scrollId = rsp.getScrollId();
View Full Code Here

Examples of org.elasticsearch.index.query.BoolQueryBuilder.must()

          int oldfixes = 0;
         
          //get old docs from es
          SearchRequestBuilder searchOptionsOLD = esm.getSearchOptions();
          BoolQueryBuilder boolQueryOLD = QueryBuilders.boolQuery();
          boolQueryOLD.must(QueryBuilders.rangeQuery(DocumentPojo.created_).from(cleanseStartTime));
          boolQueryOLD.must(QueryBuilders.termQuery(DocumentPojo.sourceKey_, sp.getKey()));
          searchOptionsOLD.addSort(DocumentPojo.created_, SortOrder.ASC);
          searchOptionsOLD.setSize(rows);
          SearchResponse rspOLD = esm.doQuery(boolQueryOLD, searchOptionsOLD);
          SearchHit[] docsOLD = rspOLD.getHits().getHits();
View Full Code Here

Examples of org.elasticsearch.index.query.BoolQueryBuilder.must()

         
          //get old docs from es
          SearchRequestBuilder searchOptionsOLD = esm.getSearchOptions();
          BoolQueryBuilder boolQueryOLD = QueryBuilders.boolQuery();
          boolQueryOLD.must(QueryBuilders.rangeQuery(DocumentPojo.created_).from(cleanseStartTime));
          boolQueryOLD.must(QueryBuilders.termQuery(DocumentPojo.sourceKey_, sp.getKey()));
          searchOptionsOLD.addSort(DocumentPojo.created_, SortOrder.ASC);
          searchOptionsOLD.setSize(rows);
          SearchResponse rspOLD = esm.doQuery(boolQueryOLD, searchOptionsOLD);
          SearchHit[] docsOLD = rspOLD.getHits().getHits();
         
View Full Code Here

Examples of org.elasticsearch.index.query.BoolQueryBuilder.must()

          EntityFeaturePojo alias = null;
          if (null != aliasTable) {
            alias = aliasTable.getAliasMaster(ent1);
          }
          if (null != alias) { // Found!
            boolQuery.must(QueryBuilders.termsQuery(AssociationFeaturePojo.entity1_index_, alias.getAlias().toArray()));
          }
          else {
            boolQuery.must(QueryBuilders.termQuery(AssociationFeaturePojo.entity1_index_, ent1));
          }//TESTED
        }
View Full Code Here

Examples of org.elasticsearch.index.query.BoolQueryBuilder.must()

          }
          if (null != alias) { // Found!
            boolQuery.must(QueryBuilders.termsQuery(AssociationFeaturePojo.entity1_index_, alias.getAlias().toArray()));
          }
          else {
            boolQuery.must(QueryBuilders.termQuery(AssociationFeaturePojo.entity1_index_, ent1));
          }//TESTED
        }
      }
      if ( !verb.equals("null") )
      {
View Full Code Here

Examples of org.elasticsearch.index.query.BoolQueryBuilder.must()

        if ( field.equals(AssociationFeaturePojo.verb_) )
          term = verb;
        else
        {
          bExtraQueryTerms = true;
          boolQuery.must(QueryBuilders.queryString(new StringBuffer("+").append(verb.replaceAll("\\s+", " +")).toString()).
              defaultField(AssociationFeaturePojo.verb_));
        }
      }
      if ( !ent2.equals("null") )
      {
View Full Code Here

Examples of org.elasticsearch.index.query.BoolQueryBuilder.must()

          EntityFeaturePojo alias = null;
          if (null != aliasTable) {
            alias = aliasTable.getAliasMaster(ent2);
          }
          if (null != alias) { // Found!
            boolQuery.must(QueryBuilders.termsQuery(AssociationFeaturePojo.entity2_index_, alias.getAlias().toArray()));
          }
          else {
            boolQuery.must(QueryBuilders.termQuery(AssociationFeaturePojo.entity2_index_, ent2));
          }
        }//TESTED (cut and paste from entity1)
View Full Code Here

Examples of org.elasticsearch.index.query.BoolQueryBuilder.must()

          }
          if (null != alias) { // Found!
            boolQuery.must(QueryBuilders.termsQuery(AssociationFeaturePojo.entity2_index_, alias.getAlias().toArray()));
          }
          else {
            boolQuery.must(QueryBuilders.termQuery(AssociationFeaturePojo.entity2_index_, ent2));
          }
        }//TESTED (cut and paste from entity1)
     

      String escapedterm = null;
View Full Code Here

Examples of org.elasticsearch.index.query.BoolQueryBuilder.must()

      }
      else if (null == boolTerm) {
        term = (boolTerm = QueryBuilders.boolQuery().must(term).must(termQ));
      }
      else {
        term = (boolTerm = boolTerm.must(termQ));
      }
      sQueryTerm.append(')');
     
    }//TESTED: logic2* TOTEST: alias expansion code (logic3)
       
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.