mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-22 21:05:23 +00:00
remove unused ParseFieldMatcher imports/arguments
This commit is contained in:
parent
182e8115de
commit
9394792392
@ -24,7 +24,6 @@ import org.elasticsearch.action.ActionRequestValidationException;
|
|||||||
import org.elasticsearch.action.IndicesRequest;
|
import org.elasticsearch.action.IndicesRequest;
|
||||||
import org.elasticsearch.action.support.IndicesOptions;
|
import org.elasticsearch.action.support.IndicesOptions;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
|
@ -23,7 +23,6 @@ import org.apache.lucene.util.BytesRef;
|
|||||||
import org.apache.lucene.util.Version;
|
import org.apache.lucene.util.Version;
|
||||||
import org.elasticsearch.ElasticsearchParseException;
|
import org.elasticsearch.ElasticsearchParseException;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.lucene.Lucene;
|
import org.elasticsearch.common.lucene.Lucene;
|
||||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||||
@ -475,7 +474,6 @@ public class BlobStoreIndexShardSnapshot implements ToXContent {
|
|||||||
private static final ParseField PARSE_NUMBER_OF_FILES = new ParseField("number_of_files");
|
private static final ParseField PARSE_NUMBER_OF_FILES = new ParseField("number_of_files");
|
||||||
private static final ParseField PARSE_TOTAL_SIZE = new ParseField("total_size");
|
private static final ParseField PARSE_TOTAL_SIZE = new ParseField("total_size");
|
||||||
private static final ParseField PARSE_FILES = new ParseField("files");
|
private static final ParseField PARSE_FILES = new ParseField("files");
|
||||||
private static final ParseFieldMatcher parseFieldMatcher = ParseFieldMatcher.EMPTY;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Serializes shard snapshot metadata info into JSON
|
* Serializes shard snapshot metadata info into JSON
|
||||||
@ -559,5 +557,4 @@ public class BlobStoreIndexShardSnapshot implements ToXContent {
|
|||||||
return new BlobStoreIndexShardSnapshot(snapshot, indexVersion, Collections.unmodifiableList(indexFiles),
|
return new BlobStoreIndexShardSnapshot(snapshot, indexVersion, Collections.unmodifiableList(indexFiles),
|
||||||
startTime, time, numberOfFiles, totalSize);
|
startTime, time, numberOfFiles, totalSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@ package org.elasticsearch.index.snapshots.blobstore;
|
|||||||
|
|
||||||
import org.elasticsearch.ElasticsearchParseException;
|
import org.elasticsearch.ElasticsearchParseException;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.xcontent.ToXContent;
|
import org.elasticsearch.common.xcontent.ToXContent;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
@ -153,7 +152,6 @@ public class BlobStoreIndexShardSnapshots implements Iterable<SnapshotFiles>, To
|
|||||||
static final ParseField FILES = new ParseField("files");
|
static final ParseField FILES = new ParseField("files");
|
||||||
static final ParseField SNAPSHOTS = new ParseField("snapshots");
|
static final ParseField SNAPSHOTS = new ParseField("snapshots");
|
||||||
}
|
}
|
||||||
private static final ParseFieldMatcher parseFieldMatcher = ParseFieldMatcher.EMPTY;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes index file for the shard in the following format.
|
* Writes index file for the shard in the following format.
|
||||||
|
@ -57,7 +57,7 @@ public class RangeAggregationBuilder extends AbstractRangeBuilder<RangeAggregati
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Range parseRange(XContentParser parser, QueryParseContext context) throws IOException {
|
private static Range parseRange(XContentParser parser, QueryParseContext context) throws IOException {
|
||||||
return Range.fromXContent(parser, context.getParseFieldMatcher());
|
return Range.fromXContent(parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RangeAggregationBuilder(String name) {
|
public RangeAggregationBuilder(String name) {
|
||||||
|
@ -20,7 +20,6 @@ package org.elasticsearch.search.aggregations.bucket.range;
|
|||||||
|
|
||||||
import org.apache.lucene.index.LeafReaderContext;
|
import org.apache.lucene.index.LeafReaderContext;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.io.stream.Writeable;
|
import org.elasticsearch.common.io.stream.Writeable;
|
||||||
@ -122,7 +121,7 @@ public class RangeAggregator extends BucketsAggregator {
|
|||||||
return new Range(key, from, fromAsStr, to, toAsStr);
|
return new Range(key, from, fromAsStr, to, toAsStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Range fromXContent(XContentParser parser, ParseFieldMatcher parseFieldMatcher) throws IOException {
|
public static Range fromXContent(XContentParser parser) throws IOException {
|
||||||
XContentParser.Token token;
|
XContentParser.Token token;
|
||||||
String currentFieldName = null;
|
String currentFieldName = null;
|
||||||
double from = Double.NEGATIVE_INFINITY;
|
double from = Double.NEGATIVE_INFINITY;
|
||||||
|
@ -60,7 +60,7 @@ public class DateRangeAggregationBuilder extends AbstractRangeBuilder<DateRangeA
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Range parseRange(XContentParser parser, QueryParseContext context) throws IOException {
|
private static Range parseRange(XContentParser parser, QueryParseContext context) throws IOException {
|
||||||
return Range.fromXContent(parser, context.getParseFieldMatcher());
|
return Range.fromXContent(parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DateRangeAggregationBuilder(String name) {
|
public DateRangeAggregationBuilder(String name) {
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
package org.elasticsearch.search.aggregations.bucket.range.geodistance;
|
package org.elasticsearch.search.aggregations.bucket.range.geodistance;
|
||||||
|
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.ParsingException;
|
import org.elasticsearch.common.ParsingException;
|
||||||
import org.elasticsearch.common.geo.GeoDistance;
|
import org.elasticsearch.common.geo.GeoDistance;
|
||||||
import org.elasticsearch.common.geo.GeoPoint;
|
import org.elasticsearch.common.geo.GeoPoint;
|
||||||
@ -32,8 +31,8 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
|||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser.Token;
|
import org.elasticsearch.common.xcontent.XContentParser.Token;
|
||||||
import org.elasticsearch.index.query.QueryParseContext;
|
import org.elasticsearch.index.query.QueryParseContext;
|
||||||
import org.elasticsearch.search.aggregations.AggregatorFactories.Builder;
|
|
||||||
import org.elasticsearch.search.aggregations.AggregationBuilder;
|
import org.elasticsearch.search.aggregations.AggregationBuilder;
|
||||||
|
import org.elasticsearch.search.aggregations.AggregatorFactories.Builder;
|
||||||
import org.elasticsearch.search.aggregations.AggregatorFactory;
|
import org.elasticsearch.search.aggregations.AggregatorFactory;
|
||||||
import org.elasticsearch.search.aggregations.InternalAggregation.Type;
|
import org.elasticsearch.search.aggregations.InternalAggregation.Type;
|
||||||
import org.elasticsearch.search.aggregations.bucket.range.InternalRange;
|
import org.elasticsearch.search.aggregations.bucket.range.InternalRange;
|
||||||
@ -168,7 +167,6 @@ public class GeoDistanceAggregationBuilder extends ValuesSourceAggregationBuilde
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Range parseRange(XContentParser parser, QueryParseContext context) throws IOException {
|
private static Range parseRange(XContentParser parser, QueryParseContext context) throws IOException {
|
||||||
ParseFieldMatcher parseFieldMatcher = context.getParseFieldMatcher();
|
|
||||||
String fromAsStr = null;
|
String fromAsStr = null;
|
||||||
String toAsStr = null;
|
String toAsStr = null;
|
||||||
double from = 0.0;
|
double from = 0.0;
|
||||||
|
@ -21,7 +21,6 @@ package org.elasticsearch.search.aggregations.bucket.range.ip;
|
|||||||
import org.apache.lucene.document.InetAddressPoint;
|
import org.apache.lucene.document.InetAddressPoint;
|
||||||
import org.apache.lucene.util.BytesRef;
|
import org.apache.lucene.util.BytesRef;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.ParsingException;
|
import org.elasticsearch.common.ParsingException;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
@ -33,8 +32,8 @@ import org.elasticsearch.common.xcontent.XContentParser;
|
|||||||
import org.elasticsearch.common.xcontent.XContentParser.Token;
|
import org.elasticsearch.common.xcontent.XContentParser.Token;
|
||||||
import org.elasticsearch.index.query.QueryParseContext;
|
import org.elasticsearch.index.query.QueryParseContext;
|
||||||
import org.elasticsearch.script.Script;
|
import org.elasticsearch.script.Script;
|
||||||
import org.elasticsearch.search.aggregations.AggregatorFactories.Builder;
|
|
||||||
import org.elasticsearch.search.aggregations.AggregationBuilder;
|
import org.elasticsearch.search.aggregations.AggregationBuilder;
|
||||||
|
import org.elasticsearch.search.aggregations.AggregatorFactories.Builder;
|
||||||
import org.elasticsearch.search.aggregations.AggregatorFactory;
|
import org.elasticsearch.search.aggregations.AggregatorFactory;
|
||||||
import org.elasticsearch.search.aggregations.InternalAggregation;
|
import org.elasticsearch.search.aggregations.InternalAggregation;
|
||||||
import org.elasticsearch.search.aggregations.bucket.range.BinaryRangeAggregator;
|
import org.elasticsearch.search.aggregations.bucket.range.BinaryRangeAggregator;
|
||||||
@ -81,7 +80,6 @@ public final class IpRangeAggregationBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Range parseRange(XContentParser parser, QueryParseContext context) throws IOException {
|
private static Range parseRange(XContentParser parser, QueryParseContext context) throws IOException {
|
||||||
final ParseFieldMatcher parseFieldMatcher = context.getParseFieldMatcher();
|
|
||||||
String key = null;
|
String key = null;
|
||||||
String from = null;
|
String from = null;
|
||||||
String to = null;
|
String to = null;
|
||||||
|
@ -21,7 +21,6 @@ package org.elasticsearch.search.aggregations.bucket.terms.support;
|
|||||||
import com.carrotsearch.hppc.BitMixer;
|
import com.carrotsearch.hppc.BitMixer;
|
||||||
import com.carrotsearch.hppc.LongHashSet;
|
import com.carrotsearch.hppc.LongHashSet;
|
||||||
import com.carrotsearch.hppc.LongSet;
|
import com.carrotsearch.hppc.LongSet;
|
||||||
|
|
||||||
import org.apache.lucene.index.RandomAccessOrds;
|
import org.apache.lucene.index.RandomAccessOrds;
|
||||||
import org.apache.lucene.index.SortedSetDocValues;
|
import org.apache.lucene.index.SortedSetDocValues;
|
||||||
import org.apache.lucene.index.Terms;
|
import org.apache.lucene.index.Terms;
|
||||||
@ -39,7 +38,6 @@ import org.apache.lucene.util.automaton.RegExp;
|
|||||||
import org.elasticsearch.ElasticsearchParseException;
|
import org.elasticsearch.ElasticsearchParseException;
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.io.stream.Writeable;
|
import org.elasticsearch.common.io.stream.Writeable;
|
||||||
@ -103,7 +101,6 @@ public class IncludeExclude implements Writeable, ToXContent {
|
|||||||
} else if (token == XContentParser.Token.START_ARRAY) {
|
} else if (token == XContentParser.Token.START_ARRAY) {
|
||||||
return new IncludeExclude(new TreeSet<>(parseArrayToSet(parser)), null);
|
return new IncludeExclude(new TreeSet<>(parseArrayToSet(parser)), null);
|
||||||
} else if (token == XContentParser.Token.START_OBJECT) {
|
} else if (token == XContentParser.Token.START_OBJECT) {
|
||||||
ParseFieldMatcher parseFieldMatcher = context.getParseFieldMatcher();
|
|
||||||
String currentFieldName = null;
|
String currentFieldName = null;
|
||||||
Integer partition = null, numPartitions = null;
|
Integer partition = null, numPartitions = null;
|
||||||
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
|
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
|
||||||
|
@ -406,7 +406,7 @@ public class MovAvgPipelineAggregationBuilder extends AbstractPipelineAggregatio
|
|||||||
MovAvgModel.AbstractModelParser modelParser = movingAverageMdelParserRegistry.lookup(model, parser.getTokenLocation());
|
MovAvgModel.AbstractModelParser modelParser = movingAverageMdelParserRegistry.lookup(model, parser.getTokenLocation());
|
||||||
MovAvgModel movAvgModel;
|
MovAvgModel movAvgModel;
|
||||||
try {
|
try {
|
||||||
movAvgModel = modelParser.parse(settings, pipelineAggregatorName, factory.window(), context.getParseFieldMatcher());
|
movAvgModel = modelParser.parse(settings, pipelineAggregatorName, factory.window());
|
||||||
} catch (ParseException exception) {
|
} catch (ParseException exception) {
|
||||||
throw new ParsingException(parser.getTokenLocation(), "Could not parse settings for model [" + model + "].", exception);
|
throw new ParsingException(parser.getTokenLocation(), "Could not parse settings for model [" + model + "].", exception);
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
package org.elasticsearch.search.aggregations.pipeline.movavg.models;
|
package org.elasticsearch.search.aggregations.pipeline.movavg.models;
|
||||||
|
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
@ -127,8 +126,7 @@ public class EwmaModel extends MovAvgModel {
|
|||||||
|
|
||||||
public static final AbstractModelParser PARSER = new AbstractModelParser() {
|
public static final AbstractModelParser PARSER = new AbstractModelParser() {
|
||||||
@Override
|
@Override
|
||||||
public MovAvgModel parse(@Nullable Map<String, Object> settings, String pipelineName, int windowSize,
|
public MovAvgModel parse(@Nullable Map<String, Object> settings, String pipelineName, int windowSize) throws ParseException {
|
||||||
ParseFieldMatcher parseFieldMatcher) throws ParseException {
|
|
||||||
double alpha = parseDoubleParam(settings, "alpha", DEFAULT_ALPHA);
|
double alpha = parseDoubleParam(settings, "alpha", DEFAULT_ALPHA);
|
||||||
checkUnrecognizedParams(settings);
|
checkUnrecognizedParams(settings);
|
||||||
return new EwmaModel(alpha);
|
return new EwmaModel(alpha);
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
package org.elasticsearch.search.aggregations.pipeline.movavg.models;
|
package org.elasticsearch.search.aggregations.pipeline.movavg.models;
|
||||||
|
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
@ -191,8 +190,7 @@ public class HoltLinearModel extends MovAvgModel {
|
|||||||
|
|
||||||
public static final AbstractModelParser PARSER = new AbstractModelParser() {
|
public static final AbstractModelParser PARSER = new AbstractModelParser() {
|
||||||
@Override
|
@Override
|
||||||
public MovAvgModel parse(@Nullable Map<String, Object> settings, String pipelineName, int windowSize,
|
public MovAvgModel parse(@Nullable Map<String, Object> settings, String pipelineName, int windowSize) throws ParseException {
|
||||||
ParseFieldMatcher parseFieldMatcher) throws ParseException {
|
|
||||||
|
|
||||||
double alpha = parseDoubleParam(settings, "alpha", DEFAULT_ALPHA);
|
double alpha = parseDoubleParam(settings, "alpha", DEFAULT_ALPHA);
|
||||||
double beta = parseDoubleParam(settings, "beta", DEFAULT_BETA);
|
double beta = parseDoubleParam(settings, "beta", DEFAULT_BETA);
|
||||||
|
@ -23,7 +23,6 @@ package org.elasticsearch.search.aggregations.pipeline.movavg.models;
|
|||||||
import org.elasticsearch.ElasticsearchParseException;
|
import org.elasticsearch.ElasticsearchParseException;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
@ -59,11 +58,10 @@ public class HoltWintersModel extends MovAvgModel {
|
|||||||
* Parse a string SeasonalityType into the byte enum
|
* Parse a string SeasonalityType into the byte enum
|
||||||
*
|
*
|
||||||
* @param text SeasonalityType in string format (e.g. "add")
|
* @param text SeasonalityType in string format (e.g. "add")
|
||||||
* @param parseFieldMatcher Matcher for field names
|
|
||||||
* @return SeasonalityType enum
|
* @return SeasonalityType enum
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
public static SeasonalityType parse(String text, ParseFieldMatcher parseFieldMatcher) {
|
public static SeasonalityType parse(String text) {
|
||||||
if (text == null) {
|
if (text == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -379,8 +377,7 @@ public class HoltWintersModel extends MovAvgModel {
|
|||||||
|
|
||||||
public static final AbstractModelParser PARSER = new AbstractModelParser() {
|
public static final AbstractModelParser PARSER = new AbstractModelParser() {
|
||||||
@Override
|
@Override
|
||||||
public MovAvgModel parse(@Nullable Map<String, Object> settings, String pipelineName, int windowSize,
|
public MovAvgModel parse(@Nullable Map<String, Object> settings, String pipelineName, int windowSize) throws ParseException {
|
||||||
ParseFieldMatcher parseFieldMatcher) throws ParseException {
|
|
||||||
|
|
||||||
double alpha = parseDoubleParam(settings, "alpha", DEFAULT_ALPHA);
|
double alpha = parseDoubleParam(settings, "alpha", DEFAULT_ALPHA);
|
||||||
double beta = parseDoubleParam(settings, "beta", DEFAULT_BETA);
|
double beta = parseDoubleParam(settings, "beta", DEFAULT_BETA);
|
||||||
@ -399,7 +396,7 @@ public class HoltWintersModel extends MovAvgModel {
|
|||||||
Object value = settings.get("type");
|
Object value = settings.get("type");
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
if (value instanceof String) {
|
if (value instanceof String) {
|
||||||
seasonalityType = SeasonalityType.parse((String)value, parseFieldMatcher);
|
seasonalityType = SeasonalityType.parse((String)value);
|
||||||
settings.remove("type");
|
settings.remove("type");
|
||||||
} else {
|
} else {
|
||||||
throw new ParseException("Parameter [type] must be a String, type `"
|
throw new ParseException("Parameter [type] must be a String, type `"
|
||||||
|
@ -21,7 +21,6 @@ package org.elasticsearch.search.aggregations.pipeline.movavg.models;
|
|||||||
|
|
||||||
|
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
@ -106,8 +105,7 @@ public class LinearModel extends MovAvgModel {
|
|||||||
|
|
||||||
public static final AbstractModelParser PARSER = new AbstractModelParser() {
|
public static final AbstractModelParser PARSER = new AbstractModelParser() {
|
||||||
@Override
|
@Override
|
||||||
public MovAvgModel parse(@Nullable Map<String, Object> settings, String pipelineName, int windowSize,
|
public MovAvgModel parse(@Nullable Map<String, Object> settings, String pipelineName, int windowSize) throws ParseException {
|
||||||
ParseFieldMatcher parseFieldMatcher) throws ParseException {
|
|
||||||
checkUnrecognizedParams(settings);
|
checkUnrecognizedParams(settings);
|
||||||
return new LinearModel();
|
return new LinearModel();
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
package org.elasticsearch.search.aggregations.pipeline.movavg.models;
|
package org.elasticsearch.search.aggregations.pipeline.movavg.models;
|
||||||
|
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.io.stream.NamedWriteable;
|
import org.elasticsearch.common.io.stream.NamedWriteable;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.xcontent.ToXContent;
|
import org.elasticsearch.common.xcontent.ToXContent;
|
||||||
@ -143,11 +142,10 @@ public abstract class MovAvgModel implements NamedWriteable, ToXContent {
|
|||||||
* @param settings Map of settings, extracted from the request
|
* @param settings Map of settings, extracted from the request
|
||||||
* @param pipelineName Name of the parent pipeline agg
|
* @param pipelineName Name of the parent pipeline agg
|
||||||
* @param windowSize Size of the window for this moving avg
|
* @param windowSize Size of the window for this moving avg
|
||||||
* @param parseFieldMatcher Matcher for field names
|
|
||||||
* @return A fully built moving average model
|
* @return A fully built moving average model
|
||||||
*/
|
*/
|
||||||
public abstract MovAvgModel parse(@Nullable Map<String, Object> settings, String pipelineName,
|
public abstract MovAvgModel parse(@Nullable Map<String, Object> settings, String pipelineName,
|
||||||
int windowSize, ParseFieldMatcher parseFieldMatcher) throws ParseException;
|
int windowSize) throws ParseException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
package org.elasticsearch.search.aggregations.pipeline.movavg.models;
|
package org.elasticsearch.search.aggregations.pipeline.movavg.models;
|
||||||
|
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
@ -99,8 +98,7 @@ public class SimpleModel extends MovAvgModel {
|
|||||||
|
|
||||||
public static final AbstractModelParser PARSER = new AbstractModelParser() {
|
public static final AbstractModelParser PARSER = new AbstractModelParser() {
|
||||||
@Override
|
@Override
|
||||||
public MovAvgModel parse(@Nullable Map<String, Object> settings, String pipelineName, int windowSize,
|
public MovAvgModel parse(@Nullable Map<String, Object> settings, String pipelineName, int windowSize) throws ParseException {
|
||||||
ParseFieldMatcher parseFieldMatcher) throws ParseException {
|
|
||||||
checkUnrecognizedParams(settings);
|
checkUnrecognizedParams(settings);
|
||||||
return new SimpleModel();
|
return new SimpleModel();
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,6 @@ import org.apache.lucene.search.Query;
|
|||||||
import org.apache.lucene.util.Counter;
|
import org.apache.lucene.util.Counter;
|
||||||
import org.elasticsearch.action.search.SearchTask;
|
import org.elasticsearch.action.search.SearchTask;
|
||||||
import org.elasticsearch.action.search.SearchType;
|
import org.elasticsearch.action.search.SearchType;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.common.util.BigArrays;
|
import org.elasticsearch.common.util.BigArrays;
|
||||||
import org.elasticsearch.index.cache.bitset.BitsetFilterCache;
|
import org.elasticsearch.index.cache.bitset.BitsetFilterCache;
|
||||||
|
@ -29,7 +29,6 @@ import org.apache.lucene.util.BitSet;
|
|||||||
import org.elasticsearch.ElasticsearchParseException;
|
import org.elasticsearch.ElasticsearchParseException;
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.ParsingException;
|
import org.elasticsearch.common.ParsingException;
|
||||||
import org.elasticsearch.common.geo.GeoDistance;
|
import org.elasticsearch.common.geo.GeoDistance;
|
||||||
import org.elasticsearch.common.geo.GeoDistance.FixedSourceDistance;
|
import org.elasticsearch.common.geo.GeoDistance.FixedSourceDistance;
|
||||||
@ -398,7 +397,6 @@ public class GeoDistanceSortBuilder extends SortBuilder<GeoDistanceSortBuilder>
|
|||||||
*/
|
*/
|
||||||
public static GeoDistanceSortBuilder fromXContent(QueryParseContext context, String elementName) throws IOException {
|
public static GeoDistanceSortBuilder fromXContent(QueryParseContext context, String elementName) throws IOException {
|
||||||
XContentParser parser = context.parser();
|
XContentParser parser = context.parser();
|
||||||
ParseFieldMatcher parseFieldMatcher = context.getParseFieldMatcher();
|
|
||||||
String fieldName = null;
|
String fieldName = null;
|
||||||
List<GeoPoint> geoPoints = new ArrayList<>();
|
List<GeoPoint> geoPoints = new ArrayList<>();
|
||||||
DistanceUnit unit = DistanceUnit.DEFAULT;
|
DistanceUnit unit = DistanceUnit.DEFAULT;
|
||||||
|
@ -21,7 +21,6 @@ package org.elasticsearch.search.suggest;
|
|||||||
import org.elasticsearch.action.support.ToXContentToBytes;
|
import org.elasticsearch.action.support.ToXContentToBytes;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.ParsingException;
|
import org.elasticsearch.common.ParsingException;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
@ -140,7 +139,6 @@ public class SuggestBuilder extends ToXContentToBytes implements Writeable {
|
|||||||
|
|
||||||
public static SuggestBuilder fromXContent(QueryParseContext parseContext, Suggesters suggesters) throws IOException {
|
public static SuggestBuilder fromXContent(QueryParseContext parseContext, Suggesters suggesters) throws IOException {
|
||||||
XContentParser parser = parseContext.parser();
|
XContentParser parser = parseContext.parser();
|
||||||
ParseFieldMatcher parseFieldMatcher = parseContext.getParseFieldMatcher();
|
|
||||||
SuggestBuilder suggestBuilder = new SuggestBuilder();
|
SuggestBuilder suggestBuilder = new SuggestBuilder();
|
||||||
String fieldName = null;
|
String fieldName = null;
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@ package org.elasticsearch.search.suggest;
|
|||||||
import org.apache.lucene.analysis.Analyzer;
|
import org.apache.lucene.analysis.Analyzer;
|
||||||
import org.elasticsearch.ElasticsearchParseException;
|
import org.elasticsearch.ElasticsearchParseException;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.ParsingException;
|
import org.elasticsearch.common.ParsingException;
|
||||||
import org.elasticsearch.common.io.stream.NamedWriteable;
|
import org.elasticsearch.common.io.stream.NamedWriteable;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
@ -257,7 +256,6 @@ public abstract class SuggestionBuilder<T extends SuggestionBuilder<T>> implemen
|
|||||||
static SuggestionBuilder<?> fromXContent(QueryParseContext parseContext, Suggesters suggesters)
|
static SuggestionBuilder<?> fromXContent(QueryParseContext parseContext, Suggesters suggesters)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
XContentParser parser = parseContext.parser();
|
XContentParser parser = parseContext.parser();
|
||||||
ParseFieldMatcher parsefieldMatcher = parseContext.getParseFieldMatcher();
|
|
||||||
XContentParser.Token token;
|
XContentParser.Token token;
|
||||||
String currentFieldName = null;
|
String currentFieldName = null;
|
||||||
String suggestText = null;
|
String suggestText = null;
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
package org.elasticsearch.search.suggest.phrase;
|
package org.elasticsearch.search.suggest.phrase;
|
||||||
|
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.ParsingException;
|
import org.elasticsearch.common.ParsingException;
|
||||||
import org.elasticsearch.common.io.stream.NamedWriteable;
|
import org.elasticsearch.common.io.stream.NamedWriteable;
|
||||||
import org.elasticsearch.common.xcontent.ToXContent;
|
import org.elasticsearch.common.xcontent.ToXContent;
|
||||||
@ -67,7 +66,6 @@ public abstract class SmoothingModel implements NamedWriteable, ToXContent {
|
|||||||
|
|
||||||
public static SmoothingModel fromXContent(QueryParseContext parseContext) throws IOException {
|
public static SmoothingModel fromXContent(QueryParseContext parseContext) throws IOException {
|
||||||
XContentParser parser = parseContext.parser();
|
XContentParser parser = parseContext.parser();
|
||||||
ParseFieldMatcher parseFieldMatcher = parseContext.getParseFieldMatcher();
|
|
||||||
XContentParser.Token token;
|
XContentParser.Token token;
|
||||||
String fieldName = null;
|
String fieldName = null;
|
||||||
SmoothingModel model = null;
|
SmoothingModel model = null;
|
||||||
|
@ -26,7 +26,6 @@ import org.apache.lucene.search.spell.LuceneLevenshteinDistance;
|
|||||||
import org.apache.lucene.search.spell.NGramDistance;
|
import org.apache.lucene.search.spell.NGramDistance;
|
||||||
import org.apache.lucene.search.spell.StringDistance;
|
import org.apache.lucene.search.spell.StringDistance;
|
||||||
import org.elasticsearch.ElasticsearchParseException;
|
import org.elasticsearch.ElasticsearchParseException;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.ParsingException;
|
import org.elasticsearch.common.ParsingException;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
@ -391,7 +390,6 @@ public class TermSuggestionBuilder extends SuggestionBuilder<TermSuggestionBuild
|
|||||||
static TermSuggestionBuilder innerFromXContent(QueryParseContext parseContext) throws IOException {
|
static TermSuggestionBuilder innerFromXContent(QueryParseContext parseContext) throws IOException {
|
||||||
XContentParser parser = parseContext.parser();
|
XContentParser parser = parseContext.parser();
|
||||||
TermSuggestionBuilder tmpSuggestion = new TermSuggestionBuilder("_na_");
|
TermSuggestionBuilder tmpSuggestion = new TermSuggestionBuilder("_na_");
|
||||||
ParseFieldMatcher parseFieldMatcher = parseContext.getParseFieldMatcher();
|
|
||||||
XContentParser.Token token;
|
XContentParser.Token token;
|
||||||
String currentFieldName = null;
|
String currentFieldName = null;
|
||||||
String fieldname = null;
|
String fieldname = null;
|
||||||
|
@ -21,7 +21,6 @@ package org.elasticsearch.snapshots;
|
|||||||
import org.elasticsearch.ElasticsearchParseException;
|
import org.elasticsearch.ElasticsearchParseException;
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.action.ShardOperationFailedException;
|
import org.elasticsearch.action.ShardOperationFailedException;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.io.stream.Writeable;
|
import org.elasticsearch.common.io.stream.Writeable;
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
package org.elasticsearch.search.aggregations.pipeline.moving.avg;
|
package org.elasticsearch.search.aggregations.pipeline.moving.avg;
|
||||||
|
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.collect.EvictingQueue;
|
import org.elasticsearch.common.collect.EvictingQueue;
|
||||||
import org.elasticsearch.search.aggregations.pipeline.movavg.models.EwmaModel;
|
import org.elasticsearch.search.aggregations.pipeline.movavg.models.EwmaModel;
|
||||||
import org.elasticsearch.search.aggregations.pipeline.movavg.models.HoltLinearModel;
|
import org.elasticsearch.search.aggregations.pipeline.movavg.models.HoltLinearModel;
|
||||||
@ -605,7 +604,7 @@ public class MovAvgUnitTests extends ESTestCase {
|
|||||||
settings.put("alpha", v);
|
settings.put("alpha", v);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
parser.parse(settings, "pipeline", 10, ParseFieldMatcher.STRICT);
|
parser.parse(settings, "pipeline", 10);
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
fail(parser + " parser should not have thrown SearchParseException while parsing [" +
|
fail(parser + " parser should not have thrown SearchParseException while parsing [" +
|
||||||
v.getClass().getSimpleName() +"]");
|
v.getClass().getSimpleName() +"]");
|
||||||
@ -619,7 +618,7 @@ public class MovAvgUnitTests extends ESTestCase {
|
|||||||
settings.put("gamma", "abc");
|
settings.put("gamma", "abc");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
parser.parse(settings, "pipeline", 10, ParseFieldMatcher.STRICT);
|
parser.parse(settings, "pipeline", 10);
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
//all good
|
//all good
|
||||||
continue;
|
continue;
|
||||||
|
@ -21,7 +21,6 @@ package org.elasticsearch.search.suggest;
|
|||||||
import org.elasticsearch.action.search.SearchRequestBuilder;
|
import org.elasticsearch.action.search.SearchRequestBuilder;
|
||||||
import org.elasticsearch.action.search.SearchResponse;
|
import org.elasticsearch.action.search.SearchResponse;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.ParsingException;
|
import org.elasticsearch.common.ParsingException;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
@ -142,7 +141,6 @@ public class CustomSuggesterSearchIT extends ESIntegTestCase {
|
|||||||
|
|
||||||
static CustomSuggestionBuilder innerFromXContent(QueryParseContext parseContext) throws IOException {
|
static CustomSuggestionBuilder innerFromXContent(QueryParseContext parseContext) throws IOException {
|
||||||
XContentParser parser = parseContext.parser();
|
XContentParser parser = parseContext.parser();
|
||||||
ParseFieldMatcher parseFieldMatcher = parseContext.getParseFieldMatcher();
|
|
||||||
XContentParser.Token token;
|
XContentParser.Token token;
|
||||||
String currentFieldName = null;
|
String currentFieldName = null;
|
||||||
String fieldname = null;
|
String fieldname = null;
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
package org.elasticsearch.search.aggregations.matrix.stats;
|
package org.elasticsearch.search.aggregations.matrix.stats;
|
||||||
|
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.search.MultiValueMode;
|
import org.elasticsearch.search.MultiValueMode;
|
||||||
import org.elasticsearch.search.aggregations.support.MultiValuesSourceParser.NumericValuesSourceParser;
|
import org.elasticsearch.search.aggregations.support.MultiValuesSourceParser.NumericValuesSourceParser;
|
||||||
@ -39,7 +38,7 @@ public class MatrixStatsParser extends NumericValuesSourceParser {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean token(String aggregationName, String currentFieldName, XContentParser.Token token, XContentParser parser,
|
protected boolean token(String aggregationName, String currentFieldName, XContentParser.Token token, XContentParser parser,
|
||||||
ParseFieldMatcher parseFieldMatcher, Map<ParseField, Object> otherOptions) throws IOException {
|
Map<ParseField, Object> otherOptions) throws IOException {
|
||||||
if (MULTIVALUE_MODE_FIELD.match(currentFieldName)) {
|
if (MULTIVALUE_MODE_FIELD.match(currentFieldName)) {
|
||||||
if (token == XContentParser.Token.VALUE_STRING) {
|
if (token == XContentParser.Token.VALUE_STRING) {
|
||||||
otherOptions.put(MULTIVALUE_MODE_FIELD, parser.text());
|
otherOptions.put(MULTIVALUE_MODE_FIELD, parser.text());
|
||||||
|
@ -20,13 +20,12 @@
|
|||||||
package org.elasticsearch.search.aggregations.support;
|
package org.elasticsearch.search.aggregations.support;
|
||||||
|
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.ParsingException;
|
import org.elasticsearch.common.ParsingException;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.index.query.QueryParseContext;
|
import org.elasticsearch.index.query.QueryParseContext;
|
||||||
import org.elasticsearch.script.Script;
|
import org.elasticsearch.script.Script;
|
||||||
import org.elasticsearch.search.aggregations.Aggregator;
|
|
||||||
import org.elasticsearch.search.aggregations.AggregationBuilder.CommonFields;
|
import org.elasticsearch.search.aggregations.AggregationBuilder.CommonFields;
|
||||||
|
import org.elasticsearch.search.aggregations.Aggregator;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -85,8 +84,6 @@ public abstract class MultiValuesSourceParser<VS extends ValuesSource> implement
|
|||||||
String format = null;
|
String format = null;
|
||||||
Map<String, Object> missingMap = null;
|
Map<String, Object> missingMap = null;
|
||||||
Map<ParseField, Object> otherOptions = new HashMap<>();
|
Map<ParseField, Object> otherOptions = new HashMap<>();
|
||||||
final ParseFieldMatcher parseFieldMatcher = context.getParseFieldMatcher();
|
|
||||||
|
|
||||||
XContentParser.Token token;
|
XContentParser.Token token;
|
||||||
String currentFieldName = null;
|
String currentFieldName = null;
|
||||||
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
|
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
|
||||||
@ -101,7 +98,7 @@ public abstract class MultiValuesSourceParser<VS extends ValuesSource> implement
|
|||||||
throw new ParsingException(parser.getTokenLocation(),
|
throw new ParsingException(parser.getTokenLocation(),
|
||||||
"Unexpected token " + token + " [" + currentFieldName + "] in [" + aggregationName + "]. " +
|
"Unexpected token " + token + " [" + currentFieldName + "] in [" + aggregationName + "]. " +
|
||||||
"Multi-field aggregations do not support scripts.");
|
"Multi-field aggregations do not support scripts.");
|
||||||
} else if (!token(aggregationName, currentFieldName, token, parser, context.getParseFieldMatcher(), otherOptions)) {
|
} else if (!token(aggregationName, currentFieldName, token, parser, otherOptions)) {
|
||||||
throw new ParsingException(parser.getTokenLocation(),
|
throw new ParsingException(parser.getTokenLocation(),
|
||||||
"Unexpected token " + token + " [" + currentFieldName + "] in [" + aggregationName + "].");
|
"Unexpected token " + token + " [" + currentFieldName + "] in [" + aggregationName + "].");
|
||||||
}
|
}
|
||||||
@ -116,7 +113,7 @@ public abstract class MultiValuesSourceParser<VS extends ValuesSource> implement
|
|||||||
"Unexpected token " + token + " [" + currentFieldName + "] in [" + aggregationName + "]. " +
|
"Unexpected token " + token + " [" + currentFieldName + "] in [" + aggregationName + "]. " +
|
||||||
"Multi-field aggregations do not support scripts.");
|
"Multi-field aggregations do not support scripts.");
|
||||||
|
|
||||||
} else if (!token(aggregationName, currentFieldName, token, parser, context.getParseFieldMatcher(), otherOptions)) {
|
} else if (!token(aggregationName, currentFieldName, token, parser, otherOptions)) {
|
||||||
throw new ParsingException(parser.getTokenLocation(),
|
throw new ParsingException(parser.getTokenLocation(),
|
||||||
"Unexpected token " + token + " [" + currentFieldName + "] in [" + aggregationName + "].");
|
"Unexpected token " + token + " [" + currentFieldName + "] in [" + aggregationName + "].");
|
||||||
}
|
}
|
||||||
@ -135,11 +132,11 @@ public abstract class MultiValuesSourceParser<VS extends ValuesSource> implement
|
|||||||
"Unexpected token " + token + " [" + currentFieldName + "] in [" + aggregationName + "].");
|
"Unexpected token " + token + " [" + currentFieldName + "] in [" + aggregationName + "].");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (!token(aggregationName, currentFieldName, token, parser, context.getParseFieldMatcher(), otherOptions)) {
|
} else if (!token(aggregationName, currentFieldName, token, parser, otherOptions)) {
|
||||||
throw new ParsingException(parser.getTokenLocation(),
|
throw new ParsingException(parser.getTokenLocation(),
|
||||||
"Unexpected token " + token + " [" + currentFieldName + "] in [" + aggregationName + "].");
|
"Unexpected token " + token + " [" + currentFieldName + "] in [" + aggregationName + "].");
|
||||||
}
|
}
|
||||||
} else if (!token(aggregationName, currentFieldName, token, parser, context.getParseFieldMatcher(), otherOptions)) {
|
} else if (!token(aggregationName, currentFieldName, token, parser, otherOptions)) {
|
||||||
throw new ParsingException(parser.getTokenLocation(),
|
throw new ParsingException(parser.getTokenLocation(),
|
||||||
"Unexpected token " + token + " [" + currentFieldName + "] in [" + aggregationName + "].");
|
"Unexpected token " + token + " [" + currentFieldName + "] in [" + aggregationName + "].");
|
||||||
}
|
}
|
||||||
@ -198,8 +195,7 @@ public abstract class MultiValuesSourceParser<VS extends ValuesSource> implement
|
|||||||
* the target type of the final value output by the aggregation
|
* the target type of the final value output by the aggregation
|
||||||
* @param otherOptions
|
* @param otherOptions
|
||||||
* a {@link Map} containing the extra options parsed by the
|
* a {@link Map} containing the extra options parsed by the
|
||||||
* {@link #token(String, String, org.elasticsearch.common.xcontent.XContentParser.Token,
|
* {@link #token(String, String, XContentParser.Token, XContentParser, Map)}
|
||||||
* XContentParser, ParseFieldMatcher, Map)}
|
|
||||||
* method
|
* method
|
||||||
* @return the created factory
|
* @return the created factory
|
||||||
*/
|
*/
|
||||||
@ -219,8 +215,6 @@ public abstract class MultiValuesSourceParser<VS extends ValuesSource> implement
|
|||||||
* the current token for the parser
|
* the current token for the parser
|
||||||
* @param parser
|
* @param parser
|
||||||
* the parser
|
* the parser
|
||||||
* @param parseFieldMatcher
|
|
||||||
* the {@link ParseFieldMatcher} to use to match field names
|
|
||||||
* @param otherOptions
|
* @param otherOptions
|
||||||
* a {@link Map} of options to be populated by successive calls
|
* a {@link Map} of options to be populated by successive calls
|
||||||
* to this method which will then be passed to the
|
* to this method which will then be passed to the
|
||||||
@ -232,5 +226,5 @@ public abstract class MultiValuesSourceParser<VS extends ValuesSource> implement
|
|||||||
* if an error occurs whilst parsing
|
* if an error occurs whilst parsing
|
||||||
*/
|
*/
|
||||||
protected abstract boolean token(String aggregationName, String currentFieldName, XContentParser.Token token, XContentParser parser,
|
protected abstract boolean token(String aggregationName, String currentFieldName, XContentParser.Token token, XContentParser parser,
|
||||||
ParseFieldMatcher parseFieldMatcher, Map<ParseField, Object> otherOptions) throws IOException;
|
Map<ParseField, Object> otherOptions) throws IOException;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
|||||||
import org.elasticsearch.action.support.HandledTransportAction;
|
import org.elasticsearch.action.support.HandledTransportAction;
|
||||||
import org.elasticsearch.client.Client;
|
import org.elasticsearch.client.Client;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.collect.Tuple;
|
import org.elasticsearch.common.collect.Tuple;
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
@ -53,7 +52,6 @@ import java.util.Map;
|
|||||||
public class TransportMultiPercolateAction extends HandledTransportAction<MultiPercolateRequest, MultiPercolateResponse> {
|
public class TransportMultiPercolateAction extends HandledTransportAction<MultiPercolateRequest, MultiPercolateResponse> {
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final ParseFieldMatcher parseFieldMatcher;
|
|
||||||
private final SearchRequestParsers searchRequestParsers;
|
private final SearchRequestParsers searchRequestParsers;
|
||||||
private final NamedXContentRegistry xContentRegistry;
|
private final NamedXContentRegistry xContentRegistry;
|
||||||
|
|
||||||
@ -66,7 +64,6 @@ public class TransportMultiPercolateAction extends HandledTransportAction<MultiP
|
|||||||
this.client = client;
|
this.client = client;
|
||||||
this.searchRequestParsers = searchRequestParsers;
|
this.searchRequestParsers = searchRequestParsers;
|
||||||
this.xContentRegistry = xContentRegistry;
|
this.xContentRegistry = xContentRegistry;
|
||||||
this.parseFieldMatcher = new ParseFieldMatcher(settings);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -63,7 +63,6 @@ import java.util.List;
|
|||||||
public class TransportPercolateAction extends HandledTransportAction<PercolateRequest, PercolateResponse> {
|
public class TransportPercolateAction extends HandledTransportAction<PercolateRequest, PercolateResponse> {
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final ParseFieldMatcher parseFieldMatcher;
|
|
||||||
private final SearchRequestParsers searchRequestParsers;
|
private final SearchRequestParsers searchRequestParsers;
|
||||||
private final NamedXContentRegistry xContentRegistry;
|
private final NamedXContentRegistry xContentRegistry;
|
||||||
|
|
||||||
@ -76,7 +75,6 @@ public class TransportPercolateAction extends HandledTransportAction<PercolateRe
|
|||||||
this.client = client;
|
this.client = client;
|
||||||
this.searchRequestParsers = searchRequestParsers;
|
this.searchRequestParsers = searchRequestParsers;
|
||||||
this.xContentRegistry = xContentRegistry;
|
this.xContentRegistry = xContentRegistry;
|
||||||
this.parseFieldMatcher = new ParseFieldMatcher(settings);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user