mirror of https://github.com/apache/lucene.git
LUCENE-6706: Commit from the right directory this time
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1693933 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
40e2cded26
commit
12fb9eda87
|
@ -40,6 +40,9 @@ API Changes
|
|||
abstract and has no reflection-based default implementation anymore.
|
||||
(Uwe Schindler)
|
||||
|
||||
* LUCENE-6706: PayloadTermQuery and PayloadNearQuery have been removed.
|
||||
Instead, use PayloadScoreQuery to wrap any SpanQuery. (Alan Woodward)
|
||||
|
||||
======================= Lucene 5.3.0 =======================
|
||||
|
||||
New Features
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package org.apache.lucene.queryparser.xml.builders;
|
||||
|
||||
import org.apache.lucene.index.Term;
|
||||
import org.apache.lucene.search.payloads.AveragePayloadFunction;
|
||||
import org.apache.lucene.search.payloads.PayloadTermQuery;
|
||||
import org.apache.lucene.search.spans.SpanQuery;
|
||||
import org.apache.lucene.queryparser.xml.DOMUtils;
|
||||
import org.apache.lucene.queryparser.xml.ParserException;
|
||||
import org.apache.lucene.search.payloads.AveragePayloadFunction;
|
||||
import org.apache.lucene.search.payloads.PayloadScoreQuery;
|
||||
import org.apache.lucene.search.spans.SpanQuery;
|
||||
import org.apache.lucene.search.spans.SpanTermQuery;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
/*
|
||||
|
@ -26,7 +27,7 @@ import org.w3c.dom.Element;
|
|||
*/
|
||||
|
||||
/**
|
||||
* Builder for {@link PayloadTermQuery}
|
||||
* Builder for {@link PayloadScoreQuery}
|
||||
*/
|
||||
public class BoostingTermBuilder extends SpanBuilderBase {
|
||||
|
||||
|
@ -35,7 +36,8 @@ public class BoostingTermBuilder extends SpanBuilderBase {
|
|||
String fieldName = DOMUtils.getAttributeWithInheritanceOrFail(e, "fieldName");
|
||||
String value = DOMUtils.getNonBlankTextOrFail(e);
|
||||
|
||||
PayloadTermQuery btq = new PayloadTermQuery(new Term(fieldName, value), new AveragePayloadFunction());
|
||||
PayloadScoreQuery btq = new PayloadScoreQuery(new SpanTermQuery(new Term(fieldName, value)),
|
||||
new AveragePayloadFunction());
|
||||
btq.setBoost(DOMUtils.getAttribute(e, "boost", 1.0f));
|
||||
return btq;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue