mirror of https://github.com/apache/lucene.git
SOLR-1221: Change Solr Highlighting to use the SpanScorer with MultiTerm expansion by default
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@819314 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
94df351b87
commit
d65d0553db
|
@ -503,8 +503,8 @@ Bug Fixes
|
|||
45. SOLR-1078: Fixes to WordDelimiterFilter to avoid splitting or dropping
|
||||
international non-letter characters such as non spacing marks. (yonik)
|
||||
|
||||
46. SOLR-825: Enables highlighting for range/wildcard/fuzzy/prefix queries if using hl.usePhraseHighlighter=true
|
||||
and hl.highlightMultiTerm=true. (Mark Miller)
|
||||
46. SOLR-825, SOLR-1221: Enables highlighting for range/wildcard/fuzzy/prefix queries if using hl.usePhraseHighlighter=true
|
||||
and hl.highlightMultiTerm=true. Also make both options default to true. (Mark Miller)
|
||||
|
||||
47. SOLR-1174: Fix Logging admin form submit url for multicore. (Jacob Singh via shalin)
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInf
|
|||
*/
|
||||
private QueryScorer getSpanQueryScorer(Query query, String fieldName, TokenStream tokenStream, SolrQueryRequest request) throws IOException {
|
||||
boolean reqFieldMatch = request.getParams().getFieldBool(fieldName, HighlightParams.FIELD_MATCH, false);
|
||||
Boolean highlightMultiTerm = request.getParams().getBool(HighlightParams.HIGHLIGHT_MULTI_TERM);
|
||||
Boolean highlightMultiTerm = request.getParams().getBool(HighlightParams.HIGHLIGHT_MULTI_TERM, true);
|
||||
if(highlightMultiTerm == null) {
|
||||
highlightMultiTerm = false;
|
||||
}
|
||||
|
@ -306,8 +306,9 @@ public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInf
|
|||
}
|
||||
|
||||
Highlighter highlighter;
|
||||
if (Boolean.valueOf(req.getParams().get(HighlightParams.USE_PHRASE_HIGHLIGHTER))) {
|
||||
// wrap CachingTokenFilter around TokenStream for reuse
|
||||
if (Boolean.valueOf(req.getParams().get(HighlightParams.USE_PHRASE_HIGHLIGHTER, "true"))) {
|
||||
// TODO: this is not always necessary - eventually we would like to avoid this wrap
|
||||
// when it is not needed.
|
||||
tstream = new CachingTokenFilter(tstream);
|
||||
|
||||
// get highlighter
|
||||
|
|
|
@ -585,6 +585,7 @@ public class HighlighterTest extends AbstractSolrTestCase {
|
|||
args.put("hl.fl", "t_text");
|
||||
args.put("hl.fragsize", "40");
|
||||
args.put("hl.snippets", "10");
|
||||
args.put("hl.usePhraseHighlighter", "false");
|
||||
|
||||
TestHarness.LocalRequestFactory sumLRF = h.getRequestFactory(
|
||||
"standard", 0, 200, args);
|
||||
|
|
Loading…
Reference in New Issue