@Override protected Query doToQuery(QueryShardContext context) throws IOException { Query innerBig = big.toQuery(context); assert innerBig instanceof SpanQuery; Query innerLittle = little.toQuery(context); assert innerLittle instanceof SpanQuery; return new SpanWithinQuery((SpanQuery) innerBig, (SpanQuery) innerLittle); }
@Override protected SpanQuery doToQuery(QueryShardContext context) throws IOException { String fieldInQuery = fieldName; MappedFieldType fieldType = context.fieldMapper(fieldName); if (fieldType != null) { fieldInQuery = fieldType.name(); } Query innerQuery = queryBuilder.toQuery(context); assert innerQuery instanceof SpanQuery; return new FieldMaskingSpanQuery((SpanQuery) innerQuery, fieldInQuery); }