You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ko...@apache.org on 2012/06/15 03:15:27 UTC
svn commit: r1350436 - in /lucene/dev/trunk/solr: CHANGES.txt
core/src/java/org/apache/solr/highlight/WeightedFragListBuilder.java
example/solr/conf/solrconfig.xml
Author: koji
Date: Fri Jun 15 01:15:26 2012
New Revision: 1350436
URL: http://svn.apache.org/viewvc?rev=1350436&view=rev
Log:
SOLR-3542: add WeightedFragListBuilder
Added:
lucene/dev/trunk/solr/core/src/java/org/apache/solr/highlight/WeightedFragListBuilder.java
Modified:
lucene/dev/trunk/solr/CHANGES.txt
lucene/dev/trunk/solr/example/solr/conf/solrconfig.xml
Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1350436&r1=1350435&r2=1350436&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Fri Jun 15 01:15:26 2012
@@ -363,6 +363,9 @@ New Features
to schema.xml's <copyField/> 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
----------------------
Added: lucene/dev/trunk/solr/core/src/java/org/apache/solr/highlight/WeightedFragListBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/highlight/WeightedFragListBuilder.java?rev=1350436&view=auto
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/highlight/WeightedFragListBuilder.java (added)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/highlight/WeightedFragListBuilder.java Fri Jun 15 01:15:26 2012
@@ -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 $";
+ }
+}
Modified: lucene/dev/trunk/solr/example/solr/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/conf/solrconfig.xml?rev=1350436&r1=1350435&r2=1350436&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/conf/solrconfig.xml (original)
+++ lucene/dev/trunk/solr/example/solr/conf/solrconfig.xml Fri Jun 15 01:15:26 2012
@@ -1486,13 +1486,17 @@
<!-- Configure the standard fragListBuilder -->
<fragListBuilder name="simple"
- default="true"
class="solr.highlight.SimpleFragListBuilder"/>
-
+
<!-- Configure the single fragListBuilder -->
<fragListBuilder name="single"
class="solr.highlight.SingleFragListBuilder"/>
-
+
+ <!-- Configure the weighted fragListBuilder -->
+ <fragListBuilder name="weighted"
+ default="true"
+ class="solr.highlight.WeightedFragListBuilder"/>
+
<!-- default tag FragmentsBuilder -->
<fragmentsBuilder name="default"
default="true"