summaryrefslogtreecommitdiff
path: root/core/src/main/java/org/elasticsearch/search/suggest/completion
diff options
context:
space:
mode:
authorAreek Zillur <areek.zillur@elasticsearch.com>2016-03-11 13:30:11 -0500
committerAreek Zillur <areek.zillur@elasticsearch.com>2016-03-11 15:06:36 -0500
commitc9f30f2f3fb9591bf3d5ca36cb9713960d9a527d (patch)
tree710732decaa1963b7a24cd3d7e36f98904c32beb /core/src/main/java/org/elasticsearch/search/suggest/completion
parent31dcb3e18bc62945d2557cf804c7b2feff8b61ca (diff)
scope internal methods in suggest builders
Diffstat (limited to 'core/src/main/java/org/elasticsearch/search/suggest/completion')
-rw-r--r--core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java
index 00592e6c98..7244c544cf 100644
--- a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java
+++ b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java
@@ -98,12 +98,12 @@ public class CompletionSuggestionBuilder extends SuggestionBuilder<CompletionSug
protected BytesReference contextBytes = null;
protected List<String> payloadFields = Collections.emptyList();
- public CompletionSuggestionBuilder(String fieldname) {
- super(fieldname);
+ public CompletionSuggestionBuilder(String field) {
+ super(field);
}
/**
- * internal copy constructor that copies over all class fields except for the fieldname which is
+ * internal copy constructor that copies over all class fields except for the field which is
* set to the one provided in the first argument
*/
private CompletionSuggestionBuilder(String fieldname, CompletionSuggestionBuilder in) {
@@ -205,8 +205,8 @@ public class CompletionSuggestionBuilder extends SuggestionBuilder<CompletionSug
super("_na_");
}
- private InnerBuilder field(String fieldName) {
- this.field = fieldName;
+ private InnerBuilder field(String field) {
+ this.field = field;
return this;
}
}
@@ -242,13 +242,13 @@ public class CompletionSuggestionBuilder extends SuggestionBuilder<CompletionSug
// now we should have field name, check and copy fields over to the suggestion builder we return
if (field == null) {
throw new ElasticsearchParseException(
- "required field [" + SuggestUtils.Fields.FIELD.getPreferredName() + "] is missing");
+ "the required field option [" + SuggestUtils.Fields.FIELD.getPreferredName() + "] is missing");
}
return new CompletionSuggestionBuilder(field, builder);
}
@Override
- protected SuggestionContext innerBuild(QueryShardContext context) throws IOException {
+ public SuggestionContext build(QueryShardContext context) throws IOException {
CompletionSuggestionContext suggestionContext = new CompletionSuggestionContext(context);
// copy over common settings to each suggestion builder
final MapperService mapperService = context.getMapperService();
@@ -301,8 +301,8 @@ public class CompletionSuggestionBuilder extends SuggestionBuilder<CompletionSug
}
@Override
- public CompletionSuggestionBuilder doReadFrom(StreamInput in, String fieldname) throws IOException {
- CompletionSuggestionBuilder completionSuggestionBuilder = new CompletionSuggestionBuilder(fieldname);
+ public CompletionSuggestionBuilder doReadFrom(StreamInput in, String field) throws IOException {
+ CompletionSuggestionBuilder completionSuggestionBuilder = new CompletionSuggestionBuilder(field);
if (in.readBoolean()) {
int numPayloadField = in.readVInt();
List<String> payloadFields = new ArrayList<>(numPayloadField);