diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 0e726eb27ca..4eb25e50ff0 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -363,6 +363,9 @@ New Features to schema.xml's declaration but as an update processor that can be combined with other processors in any order. (Jan Høydahl & hossman) +* SOLR-3542: Add WeightedFragListBuilder for FVH and set it to default fragListBuilder + in example solrconfig.xml. (Sebastian Lutze, koji) + Optimizations ---------------------- diff --git a/solr/core/src/java/org/apache/solr/highlight/WeightedFragListBuilder.java b/solr/core/src/java/org/apache/solr/highlight/WeightedFragListBuilder.java new file mode 100644 index 00000000000..a63092eb269 --- /dev/null +++ b/solr/core/src/java/org/apache/solr/highlight/WeightedFragListBuilder.java @@ -0,0 +1,50 @@ +/** + * 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. + */ + +package org.apache.solr.highlight; + +import org.apache.lucene.search.vectorhighlight.FragListBuilder; +import org.apache.solr.common.params.SolrParams; + +public class WeightedFragListBuilder extends HighlightingPluginBase implements + SolrFragListBuilder { + + @Override + public FragListBuilder getFragListBuilder(SolrParams params) { + // NOTE: This class (currently) makes no use of params + // If that ever changes, it should wrap them with defaults... + // params = SolrParams.wrapDefaults(params, defaults) + + numRequests++; + + return new org.apache.lucene.search.vectorhighlight.WeightedFragListBuilder(); + } + + /////////////////////////////////////////////////////////////////////// + //////////////////////// SolrInfoMBeans methods /////////////////////// + /////////////////////////////////////////////////////////////////////// + + @Override + public String getDescription() { + return "WeightedFragListBuilder"; + } + + @Override + public String getSource() { + return "$URL: http://svn.apache.org/repos/asf/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/highlight/WeightedFragListBuilder.java $"; + } +} diff --git a/solr/example/solr/conf/solrconfig.xml b/solr/example/solr/conf/solrconfig.xml index c69d25c0757..5e586157cc7 100755 --- a/solr/example/solr/conf/solrconfig.xml +++ b/solr/example/solr/conf/solrconfig.xml @@ -1486,13 +1486,17 @@ - + - + + + +