Apache Solr open-source search software
SOLR-20: moving private static final Highlight params to a common class
Ryan McKinley5e8f1347d93f
diff --git a/src/java/org/apache/solr/common/params/HighlightParams.java b/src/java/org/apache/solr/common/params/HighlightParams.javanew file mode 100644index 00000000000..3bbd90efbd1--- /dev/null+++ b/src/java/org/apache/solr/common/params/HighlightParams.java@@ -0,0 +1,40 @@+/**+ * 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.common.params;++/**+ *+ * @author ryan+ * @version $Id$+ * @since solr 1.3+ */+public interface HighlightParams {++ public static final String SIMPLE = "simple";++ public static final String HIGHLIGHT = "hl";+ public static final String PREFIX = "hl.";+ public static final String FIELDS = PREFIX+"fl";+ public static final String SNIPPETS = PREFIX+"snippets";+ public static final String FRAGSIZE = PREFIX+"fragsize";+ public static final String FORMATTER = PREFIX+"formatter";+ public static final String SIMPLE_PRE = PREFIX+SIMPLE+".pre";+ public static final String SIMPLE_POST = PREFIX+SIMPLE+".post";+ public static final String FIELD_MATCH = PREFIX+"requireFieldMatch";++}diff --git a/src/java/org/apache/solr/util/HighlightingUtils.java b/src/java/org/apache/solr/util/HighlightingUtils.javaindex 824919130e9..86858eec1bf 100644--- a/src/java/org/apache/solr/util/HighlightingUtils.java+++ b/src/java/org/apache/solr/util/HighlightingUtils.java@@ -28,6 +28,7 @@ import java.util.ArrayList;import java.util.ListIterator;import org.apache.solr.common.params.DefaultSolrParams;+import org.apache.solr.common.params.HighlightParams;import org.apache.solr.common.params.MapSolrParams;import org.apache.solr.common.params.SolrParams;import org.apache.solr.common.util.NamedList;@@ -46,19 +47,8 @@ import org.apache.lucene.search.highlight.*;/*** Collection of Utility and Factory methods for Highlighting.*/-public class HighlightingUtils {- private static final String SIMPLE = "simple";-- private static final String HIGHLIGHT = "hl";- private static final String PREFIX = "hl.";- private static final String FIELDS = PREFIX+"fl";- private static final String SNIPPETS = PREFIX+"snippets";- private static final String FRAGSIZE = PREFIX+"fragsize";- private static final String FORMATTER = PREFIX+"formatter";- private static final String SIMPLE_PRE = PREFIX+SIMPLE+".pre";- private static final String SIMPLE_POST = PREFIX+SIMPLE+".post";- private static final String FIELD_MATCH = PREFIX+"requireFieldMatch";-+public class HighlightingUtils implements HighlightParams {+private static SolrParams DEFAULTS = null;static {Map<String,String> map = new HashMap<String,String>();