protected MappedFieldType.Relation getRelation(QueryRewriteContext queryRewriteContext) throws IOException { QueryShardContext shardContext = queryRewriteContext.convertToShardContext(); // If the context is null we are not on the shard and cannot // rewrite so just pretend there is an intersection so that the rewrite is a noop if (shardContext == null || shardContext.getIndexReader() == null) { return MappedFieldType.Relation.INTERSECTS; } final MapperService mapperService = shardContext.getMapperService(); final MappedFieldType fieldType = mapperService.fullName(fieldName); if (fieldType == null) { // no field means we have no values return MappedFieldType.Relation.DISJOINT; } else { DateMathParser dateMathParser = getForceDateParser(); return fieldType.isFieldWithinQuery(shardContext.getIndexReader(), from, to, includeLower, includeUpper, timeZone, dateMathParser, queryRewriteContext); } }
MappedFieldType mapper = context.fieldMapper(this.fieldName); if (mapper != null) { DateMathParser forcedDateParser = getForceDateParser(); query = mapper.rangeQuery( from, to, includeLower, includeUpper,
protected MappedFieldType.Relation getRelation(QueryRewriteContext queryRewriteContext) throws IOException { QueryShardContext shardContext = queryRewriteContext.convertToShardContext(); // If the context is null we are not on the shard and cannot // rewrite so just pretend there is an intersection so that the rewrite is a noop if (shardContext == null || shardContext.getIndexReader() == null) { return MappedFieldType.Relation.INTERSECTS; } final MapperService mapperService = shardContext.getMapperService(); final MappedFieldType fieldType = mapperService.fullName(fieldName); if (fieldType == null) { // no field means we have no values return MappedFieldType.Relation.DISJOINT; } else { DateMathParser dateMathParser = getForceDateParser(); return fieldType.isFieldWithinQuery(shardContext.getIndexReader(), from, to, includeLower, includeUpper, timeZone, dateMathParser, queryRewriteContext); } }
protected MappedFieldType.Relation getRelation(QueryRewriteContext queryRewriteContext) throws IOException { QueryShardContext shardContext = queryRewriteContext.convertToShardContext(); // If the context is null we are not on the shard and cannot // rewrite so just pretend there is an intersection so that the rewrite is a noop if (shardContext == null || shardContext.getIndexReader() == null) { return MappedFieldType.Relation.INTERSECTS; } final MapperService mapperService = shardContext.getMapperService(); final MappedFieldType fieldType = mapperService.fullName(fieldName); if (fieldType == null) { // no field means we have no values return MappedFieldType.Relation.DISJOINT; } else { DateMathParser dateMathParser = getForceDateParser(); return fieldType.isFieldWithinQuery(shardContext.getIndexReader(), from, to, includeLower, includeUpper, timeZone, dateMathParser, queryRewriteContext); } }
timeZone, getForceDateParser(), context); } else if (mapper instanceof DateFieldMapper.DateFieldType) { timeZone, getForceDateParser(), context); } else if (mapper instanceof RangeFieldMapper.RangeFieldType) { DateMathParser forcedDateParser = null;
MappedFieldType mapper = context.fieldMapper(this.fieldName); if (mapper != null) { DateMathParser forcedDateParser = getForceDateParser(); query = mapper.rangeQuery( from, to, includeLower, includeUpper,