Package org.elasticsearch.index.query

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


      }
      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

      }
      else if (null == boolTerm) {
        term = (boolTerm = QueryBuilders.boolQuery().must(term).must(termQ));
      }
      else {
        term = (boolTerm = boolTerm.must(termQ));
      }
      sQueryTerm.append(')');
     
    }//TESTED (logic5-10)
View Full Code Here

        {
          term = (boolTerm = QueryBuilders.boolQuery().must(term).must(termQ));
        }
        else
        {
          term = (boolTerm = boolTerm.must(termQ));
        }       
      }
     
      sQueryTerm.append(')');         
    } // (end geo)
View Full Code Here

        }
        else if (null == boolTerm) {
          term = (boolTerm = QueryBuilders.boolQuery().must(term).must(termQ));
        }
        else {
          term = (boolTerm = boolTerm.must(termQ));
        }       
      }
     
      sQueryTerm.append(')');               
    } // (end event)
View Full Code Here

          //in the end this results in query = CURR_GEO_QUERY AND (ONT_TYPE = [ont1 OR ont2 OR ont3])     
          if ( parseFields == GeoParseField.ALL || parseFields == GeoParseField.ENT )
          {           
            //use a 2nd variable so we dont have to keep casting termQ to BoolQuery
            BoolQueryBuilder subQ = QueryBuilders.boolQuery().must(QueryBuilders.constantScoreQuery(FilterBuilders.geoDistanceFilter(EntityPojo.docQuery_geotag_).distance(geo.dist).point(lat, lon)).boost(1.0F));
            subQ.must(QueryBuilders.termQuery(EntityPojo.docQuery_ontology_type_, ont_terms.toArray()))
            boolQ.should(QueryBuilders.nestedQuery(DocumentPojo.entities_, subQ).scoreMode("max").boost((float)1.0));
          }
         
          //ASSOC AND DOCGEO (only added if ont is point or null)
          if ( parseFields == GeoParseField.ALL || parseFields == GeoParseField.ASSOC )
View Full Code Here

          //in the end this results in query = CURR_GEO_QUERY AND (ONT_TYPE = [ont1 OR ont2 OR ont3]) 
          if ( parseFields == GeoParseField.ALL || parseFields == GeoParseField.ENT )
          {
            //use a 2nd variable so we dont have to keep casting termQ to BoolQuery
            BoolQueryBuilder subQ = QueryBuilders.boolQuery().must(QueryBuilders.constantScoreQuery(FilterBuilders.geoDistanceFilter(EntityPojo.docQuery_geotag_).distance(Double.parseDouble(geo.dist), DistanceUnit.KILOMETERS).point(lat, lon)).boost(1.0F));
            subQ.must(QueryBuilders.termsQuery(EntityPojo.docQuery_ontology_type_, ont_terms.toArray()));                         
            boolQ.should(QueryBuilders.nestedQuery(DocumentPojo.entities_, subQ).scoreMode("max").boost((float)1.0));
          }
          //ASSOC AND DOCGEO (only added if ont is point or null)
          if ( parseFields == GeoParseField.ALL || parseFields == GeoParseField.ASSOC )
            boolQ.should(QueryBuilders.nestedQuery(DocumentPojo.associations_, FilterBuilders.geoDistanceFilter(AssociationPojo.docQuery_geotag_).distance(Double.parseDouble(geo.dist), DistanceUnit.KILOMETERS).point(lat, lon)).scoreMode("max").boost((float)1.0));
View Full Code Here

        // If we've got this far, we've found all the different locations       
        if ( parseFields == GeoParseField.ALL || parseFields == GeoParseField.ENT )
        {
          //use a 2nd variable so we dont have to keep casting termQ to BoolQuery
          BoolQueryBuilder subQ = QueryBuilders.boolQuery().must(QueryBuilders.constantScoreQuery(FilterBuilders.geoBoundingBoxFilter(EntityPojo.docQuery_geotag_).topLeft(latmax,lonmin).bottomRight(latmin, lonmax)).boost(1.0F));
          subQ.must(QueryBuilders.termsQuery(EntityPojo.docQuery_ontology_type_, ont_terms.toArray()));                         
          boolQ.should(QueryBuilders.nestedQuery(DocumentPojo.entities_, subQ).scoreMode("max").boost((float)1.0));
        }
       
        //ASSOC AND DOCGEO (only added if ont is point or null)     
        if ( parseFields == GeoParseField.ALL || parseFields == GeoParseField.ASSOC )
View Full Code Here

        sQueryTerm.append(" AND ");       
      }
      bFirstTerm = false;
      sQueryTerm.append("(verb,verb_category:").append(assoc.verb).append(")");
     
      query.must(QueryBuilders.boolQuery().should(QueryBuilders.queryString(assoc.verb).field(AssociationPojo.docQuery_verb_)).
                          should(QueryBuilders.queryString(assoc.verb).field(AssociationPojo.docQuery_verb_category_)));
     
      sQueryTerm.append(')');
      nTerms++;
    }//TESTED
View Full Code Here

      if (!bFirstTerm) {
        sQueryTerm.append(" AND ");       
      }
      bFirstTerm = false;
      sQueryTerm.append("(");
      query.must(this.parseGeoTerm(assoc.geo, sQueryTerm, GeoParseField.ASSOC));
      sQueryTerm.append(')');
      nTerms++;
    }//TOTEST
    if (null != assoc.time)
    {
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.