| Chunk |
|---|
| Conflicting content |
|---|
private static Map |
| Solution content |
|---|
private static Map |
| File |
|---|
| Suggesters.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Other |
| Chunk |
|---|
| Conflicting content |
|---|
package org.elasticsearch.search.suggest; <<<<<<< HEAD import org.apache.lucene.util.BytesRef; ======= import org.apache.lucene.analysis.Analyzer; >>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929 import org.elasticsearch.action.support.ToXContentToBytes; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.ParseField; |
| Solution content |
|---|
package org.elasticsearch.search.suggest; import org.apache.lucene.analysis.Analyzer; import org.elasticsearch.action.support.ToXContentToBytes; import org.elasticsearch.common.ParseField; |
| File |
|---|
| SuggestionBuilder.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
protected abstract SuggestionBuilder |
| Solution content |
|---|
protected abstract SuggestionBuilder |
| File |
|---|
| SuggestionBuilder.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Comment |
| Method declaration |
| Method interface |
| Method signature |
| Chunk |
|---|
| Conflicting content |
|---|
return suggestions;
}
<<<<<<< HEAD
public static class SuggestionContext {
=======
public abstract static class SuggestionContext {
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
private BytesRef text;
private BytesRef prefix; |
| Solution content |
|---|
return suggestions;
}
public abstract static class SuggestionContext {
private BytesRef text;
private BytesRef prefix; |
| File |
|---|
| SuggestionSearchContext.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Class signature |
| Chunk |
|---|
| Conflicting content |
|---|
private int size = 5;
private int shardSize = -1;
private QueryShardContext shardContext;
<<<<<<< HEAD
=======
private Suggester> suggester;
protected SuggestionContext(Suggester> suggester, QueryShardContext shardContext) {
this.suggester = suggester;
this.shardContext = shardContext;
}
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
public BytesRef getText() {
return text; |
| Solution content |
|---|
private int size = 5;
private int shardSize = -1;
private QueryShardContext shardContext;
private Suggester> suggester;
protected SuggestionContext(Suggester> suggester, QueryShardContext shardContext) {
this.suggester = suggester;
this.shardContext = shardContext;
}
public BytesRef getText() {
return text; |
| File |
|---|
| SuggestionSearchContext.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Method declaration |
| Chunk |
|---|
| Conflicting content |
|---|
this.shardSize = shardSize;
}
<<<<<<< HEAD
public void setShardContext(QueryShardContext context) {
this.shardContext = context;
}
public QueryShardContext getShardContext() {
return this.shardContext;
}
@Override
public String toString() {
return "[" +
"text=" + text +
",field=" + field +
",prefix=" + prefix +
",regex=" + regex +
",size=" + size +
",shardSize=" + shardSize +
",suggester=" + suggester +
",analyzer=" + analyzer +
",shardContext=" + shardContext +
"]";
=======
public QueryShardContext getShardContext() {
return this.shardContext;
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
}
}
|
| Solution content |
|---|
",analyzer=" + analyzer +
this.shardSize = shardSize;
}
public QueryShardContext getShardContext() {
return this.shardContext;
}
@Override
public String toString() {
return "[" +
"text=" + text +
",field=" + field +
",prefix=" + prefix +
",regex=" + regex +
",size=" + size +
",shardSize=" + shardSize +
",suggester=" + suggester +
",shardContext=" + shardContext +
"]";
}
}
|
| File |
|---|
| SuggestionSearchContext.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| Annotation |
| Attribute |
| Method declaration |
| Method signature |
| Return statement |
| Chunk |
|---|
| Conflicting content |
|---|
@Override
public SuggestionSearchContext.SuggestionContext parse(XContentParser parser, QueryShardContext shardContext) throws IOException {
MapperService mapperService = shardContext.getMapperService();
<<<<<<< HEAD
final CompletionSuggestionContext suggestion = new CompletionSuggestionContext(completionSuggester, mapperService);
=======
final CompletionSuggestionContext suggestion = new CompletionSuggestionContext(shardContext);
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
final ContextAndSuggest contextAndSuggest = new ContextAndSuggest(mapperService);
TLP_PARSER.parse(parser, suggestion, contextAndSuggest);
final XContentParser contextParser = contextAndSuggest.contextParser; |
| Solution content |
|---|
@Override
public SuggestionSearchContext.SuggestionContext parse(XContentParser parser, QueryShardContext shardContext) throws IOException {
MapperService mapperService = shardContext.getMapperService();
final CompletionSuggestionContext suggestion = new CompletionSuggestionContext(shardContext);
final ContextAndSuggest contextAndSuggest = new ContextAndSuggest(mapperService);
TLP_PARSER.parse(parser, suggestion, contextAndSuggest);
final XContentParser contextParser = contextAndSuggest.contextParser; |
| File |
|---|
| CompletionSuggestParser.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Other |
| Chunk |
|---|
| Conflicting content |
|---|
public class CompletionSuggester extends Suggester |
| Solution content |
|---|
public class CompletionSuggester extends Suggester |
| File |
|---|
| CompletionSuggester.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
}
@Override
<<<<<<< HEAD
protected SuggestionContext innerBuild(QueryShardContext context) throws IOException {
=======
protected SuggestionContext build(QueryShardContext context) throws IOException {
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
// NORELEASE
throw new UnsupportedOperationException();
} |
| Solution content |
|---|
}
@Override
protected SuggestionContext innerBuild(QueryShardContext context) throws IOException {
CompletionSuggestionContext suggestionContext = new CompletionSuggestionContext(context);
// copy over common settings to each suggestion builder
populateCommonFields(context.getMapperService(), suggestionContext);
// NORELEASE
// still need to populate CompletionSuggestionContext's specific settings
return suggestionContext;
} |
| File |
|---|
| CompletionSuggestionBuilder.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Method signature |
| Chunk |
|---|
| Conflicting content |
|---|
import org.apache.lucene.search.suggest.document.CompletionQuery; import org.elasticsearch.common.unit.Fuzziness; <<<<<<< HEAD import org.elasticsearch.index.mapper.MapperService; ======= >>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929 import org.elasticsearch.index.mapper.core.CompletionFieldMapper; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.search.suggest.SuggestionSearchContext; |
| Solution content |
|---|
import org.apache.lucene.search.suggest.document.CompletionQuery; import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.index.mapper.core.CompletionFieldMapper; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.search.suggest.SuggestionSearchContext; |
| File |
|---|
| CompletionSuggestionContext.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
private CompletionSuggestionBuilder.FuzzyOptionsBuilder fuzzyOptionsBuilder;
private CompletionSuggestionBuilder.RegexOptionsBuilder regexOptionsBuilder;
private Map |
| Solution content |
|---|
private CompletionSuggestionBuilder.FuzzyOptionsBuilder fuzzyOptionsBuilder;
private CompletionSuggestionBuilder.RegexOptionsBuilder regexOptionsBuilder;
private Map |
| File |
|---|
| CompletionSuggestionContext.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Method declaration |
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
this.queryContexts = queryContexts;
}
<<<<<<< HEAD
MapperService getMapperService() {
return mapperService;
}
=======
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
void setPayloadFields(Set |
| Solution content |
|---|
this.queryContexts = queryContexts;
}
void setPayloadFields(Set |
| File |
|---|
| CompletionSuggestionContext.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method declaration |
| Chunk |
|---|
| Conflicting content |
|---|
@Override
public SuggestionSearchContext.SuggestionContext parse(XContentParser parser, QueryShardContext shardContext) throws IOException {
MapperService mapperService = shardContext.getMapperService();
<<<<<<< HEAD
PhraseSuggestionContext suggestion = new PhraseSuggestionContext(suggester);
=======
ScriptService scriptService = shardContext.getScriptService();
PhraseSuggestionContext suggestion = new PhraseSuggestionContext(shardContext);
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
ParseFieldMatcher parseFieldMatcher = mapperService.getIndexSettings().getParseFieldMatcher();
XContentParser.Token token;
String fieldName = null; |
| Solution content |
|---|
@Override
public SuggestionSearchContext.SuggestionContext parse(XContentParser parser, QueryShardContext shardContext) throws IOException {
MapperService mapperService = shardContext.getMapperService();
ScriptService scriptService = shardContext.getScriptService();
PhraseSuggestionContext suggestion = new PhraseSuggestionContext(shardContext);
ParseFieldMatcher parseFieldMatcher = mapperService.getIndexSettings().getParseFieldMatcher();
XContentParser.Token token;
String fieldName = null; |
| File |
|---|
| PhraseSuggestParser.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
public final class PhraseSuggester extends Suggester |
| Solution content |
|---|
public final class PhraseSuggester extends Suggester |
| File |
|---|
| PhraseSuggester.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Method declaration |
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
import org.elasticsearch.search.suggest.SuggestionBuilder; import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext; import org.elasticsearch.search.suggest.phrase.PhraseSuggestionContext.DirectCandidateGenerator; <<<<<<< HEAD import org.elasticsearch.search.suggest.phrase.WordScorer.WordScorerFactory; ======= >>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929 import java.io.IOException; import java.util.ArrayList; |
| Solution content |
|---|
import org.elasticsearch.search.suggest.SuggestionBuilder; import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext; import org.elasticsearch.search.suggest.phrase.PhraseSuggestionContext.DirectCandidateGenerator; import java.io.IOException; import java.util.ArrayList; |
| File |
|---|
| PhraseSuggestionBuilder.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
@Override
<<<<<<< HEAD
public SuggestionContext innerBuild(QueryShardContext context) throws IOException {
PhraseSuggestionContext suggestionContext = new PhraseSuggestionContext(PhraseSuggester.PROTOTYPE);
MapperService mapperService = context.getMapperService();
suggestionContext.setShardContext(context);
=======
public SuggestionContext build(QueryShardContext context) throws IOException {
PhraseSuggestionContext suggestionContext = new PhraseSuggestionContext(context);
MapperService mapperService = context.getMapperService();
populateCommonFields(mapperService, suggestionContext);
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
suggestionContext.setSeparator(BytesRefs.toBytesRef(this.separator));
suggestionContext.setRealWordErrorLikelihood(this.realWordErrorLikelihood); |
| Solution content |
|---|
@Override
public SuggestionContext innerBuild(QueryShardContext context) throws IOException {
PhraseSuggestionContext suggestionContext = new PhraseSuggestionContext(context);
MapperService mapperService = context.getMapperService();
// copy over common settings to each suggestion builder
populateCommonFields(mapperService, suggestionContext);
suggestionContext.setSeparator(BytesRefs.toBytesRef(this.separator));
suggestionContext.setRealWordErrorLikelihood(this.realWordErrorLikelihood); |
| File |
|---|
| PhraseSuggestionBuilder.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Method invocation |
| Method signature |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
suggestionContext.setCollatePrune(this.collatePrune);
}
<<<<<<< HEAD
=======
// TODO remove this when field is mandatory in builder ctor
if (suggestionContext.getField() == null) {
throw new IllegalArgumentException("The required field option is missing");
}
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
MappedFieldType fieldType = mapperService.fullName(suggestionContext.getField());
if (fieldType == null) {
throw new IllegalArgumentException("No mapping found for field [" + suggestionContext.getField() + "]"); |
| Solution content |
|---|
builder.maxErrors = in.readFloat();
suggestionContext.setCollatePrune(this.collatePrune);
}
if (suggestionContext.model() == null) {
suggestionContext.setModel(StupidBackoffScorer.FACTORY);
}
if (this.gramSize == null || suggestionContext.generators().isEmpty()) {
final ShingleTokenFilterFactory.Factory shingleFilterFactory = SuggestUtils
.getShingleFilterFactory(suggestionContext.getAnalyzer());
if (this.gramSize == null) {
// try to detect the shingle size
if (shingleFilterFactory != null) {
suggestionContext.setGramSize(shingleFilterFactory.getMaxShingleSize());
if (suggestionContext.getAnalyzer() == null && shingleFilterFactory.getMinShingleSize() > 1
&& !shingleFilterFactory.getOutputUnigrams()) {
throw new IllegalArgumentException("The default analyzer for field: [" + suggestionContext.getField()
+ "] doesn't emit unigrams. If this is intentional try to set the analyzer explicitly");
}
}
}
if (suggestionContext.generators().isEmpty()) {
if (shingleFilterFactory != null && shingleFilterFactory.getMinShingleSize() > 1
&& !shingleFilterFactory.getOutputUnigrams() && suggestionContext.getRequireUnigram()) {
throw new IllegalArgumentException("The default candidate generator for phrase suggest can't operate on field: ["
+ suggestionContext.getField() + "] since it doesn't emit unigrams. "
+ "If this is intentional try to set the candidate generator field explicitly");
}
// use a default generator on the same field
DirectCandidateGenerator generator = new DirectCandidateGenerator();
generator.setField(suggestionContext.getField());
suggestionContext.addGenerator(generator);
}
}
return suggestionContext;
}
private static void ensureNoSmoothing(PhraseSuggestionBuilder suggestion) {
if (suggestion.smoothingModel() != null) {
throw new IllegalArgumentException("only one smoothing model supported");
}
}
@Override
public String getWriteableName() {
return SUGGESTION_NAME;
}
@Override
public void doWriteTo(StreamOutput out) throws IOException {
out.writeFloat(maxErrors);
out.writeFloat(realWordErrorLikelihood);
out.writeFloat(confidence);
out.writeOptionalVInt(gramSize);
boolean hasModel = model != null;
out.writeBoolean(hasModel);
if (hasModel) {
out.writePhraseSuggestionSmoothingModel(model);
}
out.writeBoolean(forceUnigrams);
out.writeVInt(tokenLimit);
out.writeOptionalString(preTag);
out.writeOptionalString(postTag);
out.writeString(separator);
if (collateQuery != null) {
out.writeBoolean(true);
collateQuery.writeTo(out);
} else {
out.writeBoolean(false);
}
out.writeMap(collateParams);
out.writeOptionalBoolean(collatePrune);
out.writeVInt(this.generators.size());
for (Entry |
| File |
|---|
| PhraseSuggestionBuilder.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Comment |
| If statement |
| Chunk |
|---|
| Conflicting content |
|---|
public final class TermSuggester extends Suggester |
| Solution content |
|---|
public final class TermSuggester extends Suggester |
| File |
|---|
| TermSuggester.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.index.query.QueryShardContext; <<<<<<< HEAD import org.elasticsearch.search.suggest.DirectSpellcheckerSettings; import org.elasticsearch.search.suggest.SuggestUtils; ======= >>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929 import org.elasticsearch.search.suggest.SuggestionBuilder; import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext; |
| Solution content |
|---|
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.search.suggest.DirectSpellcheckerSettings; import org.elasticsearch.search.suggest.SortBy; import org.elasticsearch.search.suggest.SuggestionBuilder; import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext; |
| File |
|---|
| TermSuggestionBuilder.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
}
@Override
<<<<<<< HEAD
protected SuggestionContext innerBuild(QueryShardContext context) throws IOException {
TermSuggestionContext suggestionContext = new TermSuggestionContext(TermSuggester.PROTOTYPE);
return fillSuggestionContext(suggestionContext);
=======
protected SuggestionContext build(QueryShardContext context) throws IOException {
// NORELEASE
throw new UnsupportedOperationException();
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
}
@Override |
| Solution content |
|---|
}
@Override
protected SuggestionContext innerBuild(QueryShardContext context) throws IOException {
TermSuggestionContext suggestionContext = new TermSuggestionContext(context);
// copy over common settings to each suggestion builder
populateCommonFields(context.getMapperService(), suggestionContext);
// Transfers the builder settings to the target TermSuggestionContext
DirectSpellcheckerSettings settings = suggestionContext.getDirectSpellCheckerSettings();
settings.accuracy(accuracy);
settings.maxEdits(maxEdits);
settings.maxInspections(maxInspections);
settings.maxTermFreq(maxTermFreq);
settings.minDocFreq(minDocFreq);
settings.minWordLength(minWordLength);
settings.prefixLength(prefixLength);
settings.sort(sort);
settings.stringDistance(stringDistance.toLucene());
settings.suggestMode(suggestMode.toLucene());
return suggestionContext;
}
@Override |
| File |
|---|
| TermSuggestionBuilder.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Comment |
| Method invocation |
| Method signature |
| Return statement |
| Throw statement |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
public DirectSpellcheckerSettings getDirectSpellCheckerSettings() {
return settings;
}
<<<<<<< HEAD
@Override
public String toString() {
return "SpellcheckerSettings" + settings + ", BaseSettings" + super.toString();
}
}
=======
}
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929 |
| Solution content |
|---|
public DirectSpellcheckerSettings getDirectSpellCheckerSettings() {
return settings;
}
@Override
public String toString() {
return "SpellcheckerSettings" + settings + ", BaseSettings" + super.toString();
}
} |
| File |
|---|
| TermSuggestionContext.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Annotation |
| Method declaration |
| Chunk |
|---|
| Conflicting content |
|---|
import java.io.IOException; import java.nio.file.Path; import java.util.Collections; <<<<<<< HEAD import java.util.Map; ======= import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; >>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929 import java.util.function.Consumer; import java.util.function.Supplier; |
| Solution content |
|---|
import java.io.IOException; import java.nio.file.Path; import java.util.Collections; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import java.util.function.Consumer; import java.util.function.Supplier; |
| File |
|---|
| AbstractSuggestionBuilderTestCase.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
return new CompiledScript(ScriptType.INLINE, "mockName", "mocklang", script);
}
};
<<<<<<< HEAD
suggesters = new Suggesters(Collections.emptyMap(), scriptService, null);
=======
suggesters = new Suggesters(Collections.emptyMap());
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
parseElement = new SuggestParseElement(suggesters);
namedWriteableRegistry = new NamedWriteableRegistry(); |
| Solution content |
|---|
return new CompiledScript(ScriptType.INLINE, "mockName", "mocklang", script);
}
};
suggesters = new Suggesters(Collections.emptyMap());
parseElement = new SuggestParseElement(suggesters);
namedWriteableRegistry = new NamedWriteableRegistry(); |
| File |
|---|
| AbstractSuggestionBuilderTestCase.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
for (int runs = 0; runs < NUMBER_OF_TESTBUILDERS; runs++) {
SuggestBuilder suggestBuilder = new SuggestBuilder();
<<<<<<< HEAD
suggestBuilder.setText(randomAsciiOfLength(10));
=======
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
SB suggestionBuilder = randomTestBuilder();
suggestBuilder.addSuggestion(suggestionBuilder);
|
| Solution content |
|---|
for (int runs = 0; runs < NUMBER_OF_TESTBUILDERS; runs++) {
SuggestBuilder suggestBuilder = new SuggestBuilder();
SB suggestionBuilder = randomTestBuilder();
suggestBuilder.addSuggestion(suggestionBuilder);
|
| File |
|---|
| AbstractSuggestionBuilderTestCase.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
if (suggestionBuilder.text() == null) {
// we either need suggestion text or global text
<<<<<<< HEAD
suggestBuilder.setText("This is some global Text");
=======
suggestBuilder.setText(randomAsciiOfLengthBetween(5, 50));
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
}
if (suggestionBuilder.text() != null && suggestionBuilder.prefix() != null) {
suggestionBuilder.prefix(null); |
| Solution content |
|---|
if (suggestionBuilder.text() == null) {
// we either need suggestion text or global text
suggestBuilder.setGlobalText(randomAsciiOfLengthBetween(5, 50));
}
if (suggestionBuilder.text() != null && suggestionBuilder.prefix() != null) {
suggestionBuilder.prefix(null); |
| File |
|---|
| AbstractSuggestionBuilderTestCase.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
xContentBuilder.prettyPrint();
}
suggestBuilder.toXContent(xContentBuilder, ToXContent.EMPTY_PARAMS);
<<<<<<< HEAD
System.out.println(suggestBuilder);
XContentParser parser = XContentHelper.createParser(xContentBuilder.bytes());
parser.nextToken(); // set cursor to START_OBJECT
SuggestionSearchContext suggestionSearchContext = parseElement.parseInternal(parser, mockShardContext);
SuggestionContext oldSchoolContext = suggestionSearchContext.suggestions().get(suggestionBuilder.name());
SuggestionContext newSchoolContext = suggestionBuilder.build(mockShardContext, suggestBuilder.getGlobalText());
assertNotSame(oldSchoolContext, newSchoolContext);
// deep comparison of analyzers is difficult here, but we check they are same class
if (oldSchoolContext.getAnalyzer() == null) {
assertNull(newSchoolContext.getAnalyzer());
} else if (newSchoolContext.getAnalyzer() == null) {
assertNull(oldSchoolContext.getAnalyzer());
} else {
assertEquals(oldSchoolContext.getAnalyzer().getClass(), newSchoolContext.getAnalyzer().getClass());
}
assertEquals(oldSchoolContext.getField(), newSchoolContext.getField());
// TODO consolidate text/prefix/regex
//assertEquals(oldSchoolContext.getPrefix(), newSchoolContext.getPrefix());
//assertEquals(oldSchoolContext.getRegex(), newSchoolContext.getRegex());
assertEquals(oldSchoolContext.getShardSize(), newSchoolContext.getShardSize());
assertEquals(oldSchoolContext.getSize(), newSchoolContext.getSize());
assertEquals(oldSchoolContext.getSuggester().getClass(), newSchoolContext.getSuggester().getClass());
// TODO consolidate text/prefix/regex
//assertEquals(oldSchoolContext.getText(), newSchoolContext.getText());
assertEquals(oldSchoolContext.getClass(), newSchoolContext.getClass());
assertSuggestionContext(oldSchoolContext, newSchoolContext);
=======
XContentParser parser = XContentHelper.createParser(xContentBuilder.bytes());
parser.nextToken(); // set cursor to START_OBJECT
SuggestionSearchContext parsedSuggestionSearchContext = parseElement.parseInternal(parser, mockShardContext);
SuggestionSearchContext buildSuggestSearchContext = suggestBuilder.build(mockShardContext);
assertEquals(parsedSuggestionSearchContext.suggestions().size(), buildSuggestSearchContext.suggestions().size());
Iterator |
| Solution content |
|---|
xContentBuilder.prettyPrint();
}
suggestBuilder.toXContent(xContentBuilder, ToXContent.EMPTY_PARAMS);
XContentParser parser = XContentHelper.createParser(xContentBuilder.bytes());
parser.nextToken(); // set cursor to START_OBJECT
SuggestionSearchContext parsedSuggestionSearchContext = parseElement.parseInternal(parser, mockShardContext);
SuggestionSearchContext buildSuggestSearchContext = suggestBuilder.build(mockShardContext);
assertEquals(parsedSuggestionSearchContext.suggestions().size(), buildSuggestSearchContext.suggestions().size());
Iterator |
| File |
|---|
| AbstractSuggestionBuilderTestCase.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Comment |
| For statement |
| If statement |
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
}
@Override
<<<<<<< HEAD
protected SuggestionContext innerBuild(QueryShardContext context) throws IOException {
Map |
| Solution content |
|---|
}
@Override
protected SuggestionContext innerBuild(QueryShardContext context) throws IOException {
Map |
| File |
|---|
| CustomSuggesterSearchIT.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Comment |
| Method signature |
| Return statement |
| Chunk |
|---|
| Conflicting content |
|---|
import org.elasticsearch.script.Template; import org.elasticsearch.search.suggest.AbstractSuggestionBuilderTestCase; import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext; <<<<<<< HEAD import org.elasticsearch.search.suggest.phrase.PhraseSuggestionBuilder.Laplace; import org.elasticsearch.search.suggest.phrase.PhraseSuggestionBuilder.LinearInterpolation; import org.elasticsearch.search.suggest.phrase.PhraseSuggestionBuilder.SmoothingModel; import org.elasticsearch.search.suggest.phrase.PhraseSuggestionBuilder.StupidBackoff; ======= >>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929 import org.elasticsearch.search.suggest.phrase.PhraseSuggestionContext.DirectCandidateGenerator; import org.junit.BeforeClass; |
| Solution content |
|---|
import org.elasticsearch.script.Template; import org.elasticsearch.search.suggest.AbstractSuggestionBuilderTestCase; import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext; import org.elasticsearch.search.suggest.phrase.PhraseSuggestionContext.DirectCandidateGenerator; import org.junit.BeforeClass; |
| File |
|---|
| PhraseSuggestionBuilderTests.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
}
}
<<<<<<< HEAD
=======
@Override
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
protected void assertSuggestionContext(SuggestionContext oldSuggestion, SuggestionContext newSuggestion) {
assertThat(oldSuggestion, instanceOf(PhraseSuggestionContext.class));
assertThat(newSuggestion, instanceOf(PhraseSuggestionContext.class)); |
| Solution content |
|---|
}
}
@Override
protected void assertSuggestionContext(SuggestionContext oldSuggestion, SuggestionContext newSuggestion) {
assertThat(oldSuggestion, instanceOf(PhraseSuggestionContext.class));
assertThat(newSuggestion, instanceOf(PhraseSuggestionContext.class)); |
| File |
|---|
| PhraseSuggestionBuilderTests.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Annotation |
| Chunk |
|---|
| Conflicting content |
|---|
package org.elasticsearch.search.suggest.term; import org.elasticsearch.search.suggest.AbstractSuggestionBuilderTestCase; <<<<<<< HEAD import org.elasticsearch.search.suggest.DirectSpellcheckerSettings; ======= >>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929 import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext; import org.elasticsearch.search.suggest.term.TermSuggestionBuilder.SortBy; import org.elasticsearch.search.suggest.term.TermSuggestionBuilder.StringDistanceImpl; |
| Solution content |
|---|
package org.elasticsearch.search.suggest.term; import org.elasticsearch.search.suggest.AbstractSuggestionBuilderTestCase; import org.elasticsearch.search.suggest.DirectSpellcheckerSettings; import org.elasticsearch.search.suggest.SortBy; import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext; import org.elasticsearch.search.suggest.term.TermSuggestionBuilder.StringDistanceImpl; |
| File |
|---|
| TermSuggestionBuilderTests.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
@Override
protected void assertSuggestionContext(SuggestionContext oldSuggestion, SuggestionContext newSuggestion) {
<<<<<<< HEAD
@SuppressWarnings("unchecked")
TermSuggestionContext oldContext = (TermSuggestionContext) oldSuggestion;
@SuppressWarnings("unchecked")
TermSuggestionContext newContext = (TermSuggestionContext) newSuggestion;
assertSpellcheckerSettings(oldContext.getDirectSpellCheckerSettings(), newContext.getDirectSpellCheckerSettings());
}
private void assertSpellcheckerSettings(DirectSpellcheckerSettings oldSettings, DirectSpellcheckerSettings newSettings) {
final double delta = 0.0d;
// make sure the objects aren't the same
assertNotSame(oldSettings, newSettings);
// make sure the objects aren't null
assertNotNull(oldSettings);
assertNotNull(newSettings);
// and now, make sure they are equal..
assertEquals(oldSettings.accuracy(), newSettings.accuracy(), delta);
assertEquals(oldSettings.maxEdits(), newSettings.maxEdits());
assertEquals(oldSettings.maxInspections(), newSettings.maxInspections());
assertEquals(oldSettings.maxTermFreq(), newSettings.maxTermFreq(), delta);
assertEquals(oldSettings.minDocFreq(), newSettings.minDocFreq(), delta);
assertEquals(oldSettings.minWordLength(), newSettings.minWordLength());
assertEquals(oldSettings.prefixLength(), newSettings.prefixLength());
assertEquals(oldSettings.sort(), newSettings.sort());
assertEquals(oldSettings.stringDistance().getClass(), newSettings.stringDistance().getClass());
assertEquals(oldSettings.suggestMode().getClass(), newSettings.suggestMode().getClass());
=======
// put assertions on TermSuggestionContext here
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
}
} |
| Solution content |
|---|
@Override
protected void assertSuggestionContext(SuggestionContext oldSuggestion, SuggestionContext newSuggestion) {
@SuppressWarnings("unchecked")
TermSuggestionContext oldContext = (TermSuggestionContext) oldSuggestion;
@SuppressWarnings("unchecked")
TermSuggestionContext newContext = (TermSuggestionContext) newSuggestion;
assertSpellcheckerSettings(oldContext.getDirectSpellCheckerSettings(), newContext.getDirectSpellCheckerSettings());
}
private void assertSpellcheckerSettings(DirectSpellcheckerSettings oldSettings, DirectSpellcheckerSettings newSettings) {
final double delta = 0.0d;
// make sure the objects aren't the same
assertNotSame(oldSettings, newSettings);
// make sure the objects aren't null
assertNotNull(oldSettings);
assertNotNull(newSettings);
// and now, make sure they are equal..
assertEquals(oldSettings.accuracy(), newSettings.accuracy(), delta);
assertEquals(oldSettings.maxEdits(), newSettings.maxEdits());
assertEquals(oldSettings.maxInspections(), newSettings.maxInspections());
assertEquals(oldSettings.maxTermFreq(), newSettings.maxTermFreq(), delta);
assertEquals(oldSettings.minDocFreq(), newSettings.minDocFreq(), delta);
assertEquals(oldSettings.minWordLength(), newSettings.minWordLength());
assertEquals(oldSettings.prefixLength(), newSettings.prefixLength());
assertEquals(oldSettings.sort(), newSettings.sort());
assertEquals(oldSettings.stringDistance().getClass(), newSettings.stringDistance().getClass());
assertEquals(oldSettings.suggestMode().getClass(), newSettings.suggestMode().getClass());
}
} |
| File |
|---|
| TermSuggestionBuilderTests.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Annotation |
| Cast expression |
| Comment |
| Method invocation |
| Method signature |
| Variable |