| Chunk |
|---|
| Conflicting content |
|---|
return s;
}
} else {
<<<<<<< HEAD
return new SloppyPhraseScorer(this, postingsFreqs, similarity,
slop, similarity.sloppyDocScorer(stats, field, context));
=======
return new SloppyPhraseScorer(this, postingsFreqs, slop, similarity.sloppyDocScorer(stats, field, context));
>>>>>>> ee46aba2c0b2579ce2d971815accfa8ff9fbab85
}
}
|
| Solution content |
|---|
return s;
}
} else {
return new SloppyPhraseScorer(this, postingsFreqs, slop, similarity.sloppyDocScorer(stats, field, context));
}
}
|
| File |
|---|
| MultiPhraseQuery.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Return statement |
| Chunk |
|---|
| Conflicting content |
|---|
if (postingsEnum == null) {
assert (reader.termDocsEnum(liveDocs, t.field(), t.bytes(), state) != null) : "termstate found but no term exists in reader";
// term does exist, but has no positions
<<<<<<< HEAD
throw new IllegalStateException("field \"" + t.field() + "\" was indexed with Field.omitTermFreqAndPositions=true; cannot run PhraseQuery (term=" + t.text() + ")");
=======
throw new IllegalStateException("field \"" + t.field() + "\" was indexed without position data; cannot run PhraseQuery (term=" + t.text() + ")");
>>>>>>> ee46aba2c0b2579ce2d971815accfa8ff9fbab85
}
// get the docFreq without seeking
TermsEnum te = reader.fields().terms(field).getThreadTermsEnum(); |
| Solution content |
|---|
if (postingsEnum == null) {
assert (reader.termDocsEnum(liveDocs, t.field(), t.bytes(), state) != null) : "termstate found but no term exists in reader";
// term does exist, but has no positions
throw new IllegalStateException("field \"" + t.field() + "\" was indexed without position data; cannot run PhraseQuery (term=" + t.text() + ")");
}
// get the docFreq without seeking
TermsEnum te = reader.fields().terms(field).getThreadTermsEnum(); |
| File |
|---|
| PhraseQuery.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Throw statement |
| Chunk |
|---|
| Conflicting content |
|---|
}
} else {
return
<<<<<<< HEAD
new SloppyPhraseScorer(this, postingsFreqs, similarity, slop, similarity.sloppyDocScorer(stats, field, context));
=======
new SloppyPhraseScorer(this, postingsFreqs, slop, similarity.sloppyDocScorer(stats, field, context));
>>>>>>> ee46aba2c0b2579ce2d971815accfa8ff9fbab85
}
}
|
| Solution content |
|---|
}
} else {
return
new SloppyPhraseScorer(this, postingsFreqs, slop, similarity.sloppyDocScorer(stats, field, context));
}
}
|
| File |
|---|
| PhraseQuery.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
import org.apache.lucene.index.IndexReader.AtomicReaderContext; import org.apache.lucene.index.Terms; // javadoc import org.apache.lucene.search.spans.SpanQuery; // javadoc <<<<<<< HEAD ======= import org.apache.lucene.util.BytesRef; >>>>>>> ee46aba2c0b2579ce2d971815accfa8ff9fbab85 import org.apache.lucene.util.SmallFloat; // javadoc import org.apache.lucene.util.TermContext; |
| Solution content |
|---|
import org.apache.lucene.index.IndexReader.AtomicReaderContext; import org.apache.lucene.index.Terms; // javadoc import org.apache.lucene.search.spans.SpanQuery; // javadoc import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.SmallFloat; // javadoc import org.apache.lucene.util.TermContext; |
| File |
|---|
| Similarity.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
* @lucene.experimental
*/
public abstract class Similarity {
<<<<<<< HEAD
public static final int NO_DOC_ID_PROVIDED = -1;
=======
>>>>>>> ee46aba2c0b2579ce2d971815accfa8ff9fbab85
/**
* Computes the normalization value for a field, given the accumulated
* state of term processing for this field (see {@link FieldInvertState}). |
| Solution content |
|---|
* @lucene.experimental
*/
public abstract class Similarity {
/**
* Computes the normalization value for a field, given the accumulated
* state of term processing for this field (see {@link FieldInvertState}). |
| File |
|---|
| Similarity.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Chunk |
|---|
| Conflicting content |
|---|
* exact {@link PhraseQuery}.
*
* @param state current processing state for this field
* @return the calculated byte norm
<<<<<<< HEAD
*/
public abstract byte computeNorm(FieldInvertState state);
/** Computes the amount of a sloppy phrase match, based on an edit distance.
* This value is summed for each sloppy phrase match in a document to form
* the frequency to be used in scoring instead of the exact term count.
*
* |
| Solution content |
|---|
*
* @param state current processing state for this field
* @return the calculated byte norm
*/
public abstract byte computeNorm(FieldInvertState state);
/**
* Compute any collection-level stats (e.g. IDF, average document length, etc) needed for scoring a query.
*/
public abstract Stats computeStats(IndexSearcher searcher, String fieldName, float queryBoost, TermContext... termContexts) throws IOException;
/**
* returns a new {@link Similarity.ExactDocScorer}.
*/
public abstract ExactDocScorer exactDocScorer(Stats stats, String fieldName, AtomicReaderContext context) throws IOException;
/**
* returns a new {@link Similarity.SloppyDocScorer}.
*/
public abstract SloppyDocScorer sloppyDocScorer(Stats stats, String fieldName, AtomicReaderContext context) throws IOException;
/**
* API for scoring exact queries such as {@link TermQuery} and
* exact {@link PhraseQuery}.
* |
| File |
|---|
| Similarity.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Class declaration |
| Comment |
| Method interface |
| Chunk |
|---|
| Conflicting content |
|---|
*/
public abstract void normalize(float queryNorm, float topLevelBoost);
}
<<<<<<< HEAD
/**
* Compute any collection-level stats (e.g. IDF, average document length, etc) needed for scoring a query.
*/
public abstract Stats computeStats(IndexSearcher searcher, String fieldName, float queryBoost, TermContext... termContexts) throws IOException;
/**
* returns a new {@link Similarity.ExactDocScorer}.
*/
public abstract ExactDocScorer exactDocScorer(Stats stats, String fieldName, AtomicReaderContext context) throws IOException;
/**
* returns a new {@link Similarity.SloppyDocScorer}.
*/
public abstract SloppyDocScorer sloppyDocScorer(Stats stats, String fieldName, AtomicReaderContext context) throws IOException;
/**
* API for scoring exact queries such as {@link TermQuery} and
* exact {@link PhraseQuery}.
* |
| Solution content |
|---|
*/
public abstract void normalize(float queryNorm, float topLevelBoost);
}
} |
| File |
|---|
| Similarity.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Class declaration |
| Comment |
| Method interface |
| Chunk |
|---|
| Conflicting content |
|---|
private PhrasePositions repeats[];
private PhrasePositions tmpPos[]; // for flipping repeating pps.
private boolean checkedRepeats;
<<<<<<< HEAD
private final Similarity similarity;
SloppyPhraseScorer(Weight weight, PhraseQuery.PostingsAndFreq[] postings, Similarity similarity,
=======
SloppyPhraseScorer(Weight weight, PhraseQuery.PostingsAndFreq[] postings,
>>>>>>> ee46aba2c0b2579ce2d971815accfa8ff9fbab85
int slop, Similarity.SloppyDocScorer docScorer) throws IOException {
super(weight, postings, docScorer);
this.slop = slop; |
| Solution content |
|---|
private PhrasePositions repeats[];
private PhrasePositions tmpPos[]; // for flipping repeating pps.
private boolean checkedRepeats;
SloppyPhraseScorer(Weight weight, PhraseQuery.PostingsAndFreq[] postings,
int slop, Similarity.SloppyDocScorer docScorer) throws IOException {
super(weight, postings, docScorer);
this.slop = slop; |
| File |
|---|
| SloppyPhraseScorer.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Method signature |
| Chunk |
|---|
| Conflicting content |
|---|
protected PayloadNearSpanScorer(Spans spans, Weight weight,
Similarity similarity, Similarity.SloppyDocScorer docScorer) throws IOException {
<<<<<<< HEAD
super(spans, weight, similarity, docScorer);
=======
super(spans, weight, docScorer);
>>>>>>> ee46aba2c0b2579ce2d971815accfa8ff9fbab85
this.spans = spans;
}
|
| Solution content |
|---|
protected PayloadNearSpanScorer(Spans spans, Weight weight,
Similarity similarity, Similarity.SloppyDocScorer docScorer) throws IOException {
super(spans, weight, docScorer);
this.spans = spans;
}
|
| File |
|---|
| PayloadNearQuery.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
@Override
public Scorer scorer(AtomicReaderContext context, ScorerContext scorerContext) throws IOException {
return new PayloadTermSpanScorer((TermSpans) query.getSpans(context),
<<<<<<< HEAD
this, similarity, similarity.sloppyDocScorer(stats, query.getField(), context));
=======
this, similarity.sloppyDocScorer(stats, query.getField(), context));
>>>>>>> ee46aba2c0b2579ce2d971815accfa8ff9fbab85
}
protected class PayloadTermSpanScorer extends SpanScorer { |
| Solution content |
|---|
@Override
public Scorer scorer(AtomicReaderContext context, ScorerContext scorerContext) throws IOException {
return new PayloadTermSpanScorer((TermSpans) query.getSpans(context),
this, similarity.sloppyDocScorer(stats, query.getField(), context));
}
protected class PayloadTermSpanScorer extends SpanScorer { |
| File |
|---|
| PayloadTermQuery.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
protected int payloadsSeen;
private final TermSpans termSpans;
<<<<<<< HEAD
public PayloadTermSpanScorer(TermSpans spans, Weight weight,
Similarity similarity, Similarity.SloppyDocScorer docScorer) throws IOException {
super(spans, weight, similarity, docScorer);
=======
public PayloadTermSpanScorer(TermSpans spans, Weight weight, Similarity.SloppyDocScorer docScorer) throws IOException {
super(spans, weight, docScorer);
>>>>>>> ee46aba2c0b2579ce2d971815accfa8ff9fbab85
termSpans = spans;
}
|
| Solution content |
|---|
}
protected int payloadsSeen;
private final TermSpans termSpans;
public PayloadTermSpanScorer(TermSpans spans, Weight weight, Similarity.SloppyDocScorer docScorer) throws IOException {
super(spans, weight, docScorer);
termSpans = spans;
|
| File |
|---|
| PayloadTermQuery.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Method signature |
| Chunk |
|---|
| Conflicting content |
|---|
protected int doc;
protected float freq;
<<<<<<< HEAD
protected final Similarity similarity;
protected final Similarity.SloppyDocScorer docScorer;
protected SpanScorer(Spans spans, Weight weight, Similarity similarity, Similarity.SloppyDocScorer docScorer)
throws IOException {
super(weight);
this.similarity = similarity;
=======
protected final Similarity.SloppyDocScorer docScorer;
protected SpanScorer(Spans spans, Weight weight, Similarity.SloppyDocScorer docScorer)
throws IOException {
super(weight);
>>>>>>> ee46aba2c0b2579ce2d971815accfa8ff9fbab85
this.docScorer = docScorer;
this.spans = spans;
|
| Solution content |
|---|
protected int doc;
protected float freq;
protected final Similarity.SloppyDocScorer docScorer;
protected SpanScorer(Spans spans, Weight weight, Similarity.SloppyDocScorer docScorer)
throws IOException {
super(weight);
this.docScorer = docScorer;
this.spans = spans;
|
| File |
|---|
| SpanScorer.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Method invocation |
| Method signature |
| Chunk |
|---|
| Conflicting content |
|---|
@Override
public Scorer scorer(AtomicReaderContext context, ScorerContext scorerContext) throws IOException {
<<<<<<< HEAD
return new SpanScorer(query.getSpans(context), this, similarity, similarity.sloppyDocScorer(stats, query.getField(), context));
=======
return new SpanScorer(query.getSpans(context), this, similarity.sloppyDocScorer(stats, query.getField(), context));
>>>>>>> ee46aba2c0b2579ce2d971815accfa8ff9fbab85
}
@Override |
| Solution content |
|---|
@Override
public Scorer scorer(AtomicReaderContext context, ScorerContext scorerContext) throws IOException {
return new SpanScorer(query.getSpans(context), this, similarity.sloppyDocScorer(stats, query.getField(), context));
}
@Override |
| File |
|---|
| SpanWeight.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Return statement |
| Chunk |
|---|
| Conflicting content |
|---|
@Override
public SloppyDocScorer sloppyDocScorer(Stats stats, String fieldName, AtomicReaderContext context) throws IOException {
<<<<<<< HEAD
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
@Override
public byte computeNorm(FieldInvertState state) {
=======
>>>>>>> ee46aba2c0b2579ce2d971815accfa8ff9fbab85
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
|
| Solution content |
|---|
@Override
public SloppyDocScorer sloppyDocScorer(Stats stats, String fieldName, AtomicReaderContext context) throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
@Override
public byte computeNorm(FieldInvertState state) {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
}
static final class JustCompileSimilarityProvider implements SimilarityProvider {
public float queryNorm(float sumOfSquaredWeights) {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
public float coord(int overlap, int maxOverlap) {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
public Similarity get(String field) {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
}
static final class JustCompileSpanFilter extends SpanFilter {
@Override
public SpanFilterResult bitSpans(AtomicReaderContext context) throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
@Override
public DocIdSet getDocIdSet(AtomicReaderContext context) throws IOException {
return null;
}
}
static final class JustCompileTopDocsCollector extends TopDocsCollector |
| File |
|---|
| JustCompileSearch.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Annotation |
| Method signature |
| Throw statement |
| Chunk |
|---|
| Conflicting content |
|---|
}
@Override
<<<<<<< HEAD
public float sloppyFreq(int distance) {
=======
public byte computeNorm(FieldInvertState state) {
>>>>>>> ee46aba2c0b2579ce2d971815accfa8ff9fbab85
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
} |
| Solution content |
|---|
}
}
package org.apache.lucene.search;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.IOException;
import org.apache.lucene.index.IndexReader.AtomicReaderContext;
import org.apache.lucene.search.Similarity.ExactDocScorer;
import org.apache.lucene.search.Similarity.SloppyDocScorer;
import org.apache.lucene.search.Similarity.Stats;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.TermContext;
import org.apache.lucene.index.FieldInvertState;
import org.apache.lucene.util.PriorityQueue;
/**
* Holds all implementations of classes in the o.a.l.search package as a
* back-compatibility test. It does not run any tests per-se, however if
* someone adds a method to an interface or abstract method to an abstract
* class, one of the implementations here will fail to compile and so we know
* back-compat policy was violated.
*/
final class JustCompileSearch {
private static final String UNSUPPORTED_MSG = "unsupported: used for back-compat testing only !";
static final class JustCompileCollector extends Collector {
@Override
public void collect(int doc) throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
@Override
public void setNextReader(AtomicReaderContext context)
throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
@Override
public void setScorer(Scorer scorer) throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
@Override
public boolean acceptsDocsOutOfOrder() {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
}
static final class JustCompileDocIdSet extends DocIdSet {
@Override
public DocIdSetIterator iterator() throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
}
static final class JustCompileDocIdSetIterator extends DocIdSetIterator {
@Override
public int docID() {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
@Override
public int nextDoc() throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
@Override
public int advance(int target) throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
}
static final class JustCompileExtendedFieldCacheLongParser implements FieldCache.LongParser {
public long parseLong(BytesRef string) {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
}
static final class JustCompileExtendedFieldCacheDoubleParser implements FieldCache.DoubleParser {
public double parseDouble(BytesRef term) {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
}
static final class JustCompileFieldComparator extends FieldComparator |
| File |
|---|
| JustCompileSearch.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Method signature |
| Chunk |
|---|
| Conflicting content |
|---|
import org.apache.lucene.index.TermsEnum; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.MultiFields; <<<<<<< HEAD import org.apache.lucene.queryParser.ParseException; ======= >>>>>>> ee46aba2c0b2579ce2d971815accfa8ff9fbab85 import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.TermContext; |
| Solution content |
|---|
import org.apache.lucene.index.TermsEnum; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.MultiFields; import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.TermContext; |
| File |
|---|
| TestMultiPhraseQuery.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
static final class JustCompileSpanScorer extends SpanScorer {
protected JustCompileSpanScorer(Spans spans, Weight weight,
<<<<<<< HEAD
Similarity similarity, Similarity.SloppyDocScorer docScorer) throws IOException {
super(spans, weight, similarity, docScorer);
=======
Similarity.SloppyDocScorer docScorer) throws IOException {
super(spans, weight, docScorer);
>>>>>>> ee46aba2c0b2579ce2d971815accfa8ff9fbab85
}
@Override |
| Solution content |
|---|
static final class JustCompileSpanScorer extends SpanScorer {
protected JustCompileSpanScorer(Spans spans, Weight weight,
Similarity.SloppyDocScorer docScorer) throws IOException {
super(spans, weight, docScorer);
}
@Override |
| File |
|---|
| JustCompileSearchSpans.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method invocation |
| Variable |