Examples of must()


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 (logic5-10)
View Full Code Here

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

        {
          term = (boolTerm = QueryBuilders.boolQuery().must(term).must(termQ));
        }
        else
        {
          term = (boolTerm = boolTerm.must(termQ));
        }       
      }
     
      sQueryTerm.append(')');         
    } // (end geo)
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(')');               
    } // (end event)
View Full Code Here

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

          //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

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

          //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

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

        // 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

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

        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

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

      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

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

      sQueryTerm.append("))");
      event1.min = "10010101";
      event1.max = assoc.time.min;
      event2.min = assoc.time.max;
      event2.max = "99990101"; // (ie the end of time, sort of!)
      combo3.must(this.parseDateTerm(event1, sbDummy, AssociationPojo.docQuery_time_start_, false)); // ie start time earlier than query
      combo3.must(this.parseDateTerm(event2, sbDummy, AssociationPojo.docQuery_time_end_, false)); // AND end time later than query
     
      query.must(combo2.should(combo3));
     
      query.must(combo2); // (this one is very simple - either one of the times must be inside the range)
View Full Code Here

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

      event1.min = "10010101";
      event1.max = assoc.time.min;
      event2.min = assoc.time.max;
      event2.max = "99990101"; // (ie the end of time, sort of!)
      combo3.must(this.parseDateTerm(event1, sbDummy, AssociationPojo.docQuery_time_start_, false)); // ie start time earlier than query
      combo3.must(this.parseDateTerm(event2, sbDummy, AssociationPojo.docQuery_time_end_, false)); // AND end time later than query
     
      query.must(combo2.should(combo3));
     
      query.must(combo2); // (this one is very simple - either one of the times must be inside the range)
      nTerms++;
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.