2
* Licensed to the Apache Software Foundation (ASF) under one or more
3
* contributor license agreements. See the NOTICE file distributed with
4
* this work for additional information regarding copyright ownership.
5
* The ASF licenses this file to You under the Apache License, Version 2.0
6
* (the "License"); you may not use this file except in compliance with
7
* the License. You may obtain a copy of the License at
9
* http://www.apache.org/licenses/LICENSE-2.0
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
18
package org.apache.solr.util;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
23
import org.apache.solr.common.util.NamedList;
26
* This class is scheduled for deletion. Please update your code to the moved package.
27
* @deprecated Use {@link org.apache.solr.common.params.DisMaxParams} instead.
30
public class DisMaxParams extends CommonParams implements org.apache.solr.common.params.DisMaxParams {
32
public static Logger log = LoggerFactory.getLogger(DisMaxParams.class);
35
/** query and init param for filtering query
36
* @deprecated use SolrParams.FQ or SolrPluginUtils.parseFilterQueries
39
public static String FQ = "fq";
42
* the default tie breaker to use in DisjunctionMaxQueries
43
* @deprecated - use explicit default with SolrParams.getFloat
46
public float tiebreaker = 0.0f;
48
* the default query fields to be used
49
* @deprecated - use explicit default with SolrParams.get
52
public String qf = null;
54
* the default phrase boosting fields to be used
55
* @deprecated - use explicit default with SolrParams.get
58
public String pf = null;
60
* the default min should match to be used
61
* @deprecated - use explicit default with SolrParams.get
64
public String mm = "100%";
66
* the default phrase slop to be used
67
* @deprecated - use explicit default with SolrParams.getInt
72
* the default boosting query to be used
73
* @deprecated - use explicit default with SolrParams.get
76
public String bq = null;
78
* the default boosting functions to be used
79
* @deprecated - use explicit default with SolrParams.get
82
public String bf = null;
84
* the default filtering query to be used
85
* @deprecated - use explicit default with SolrParams.get
88
public String fq = null;
92
* Sets the params using values from a NamedList, usefull in the
93
* init method for your handler.
96
* If any param is not of the expected type, a severe error is
97
* logged,and the param is skipped.
101
* If any param is not of in the NamedList, it is skipped and the
102
* old value is left alone.
104
* @deprecated use SolrParams.toSolrParams
108
public void setValues(NamedList args) {
110
super.setValues(args);
116
if (tmp instanceof Float) {
117
tiebreaker = ((Float)tmp).floatValue();
119
log.error("init param is not a float: " + TIE);
125
if (tmp instanceof String) {
128
log.error("init param is not a str: " + QF);
134
if (tmp instanceof String) {
137
log.error("init param is not a str: " + PF);
144
if (tmp instanceof String) {
147
log.error("init param is not a str: " + MM);
153
if (tmp instanceof Integer) {
154
pslop = ((Integer)tmp).intValue();
156
log.error("init param is not an int: " + PS);
162
if (tmp instanceof String) {
165
log.error("init param is not a str: " + BQ);
171
if (tmp instanceof String) {
174
log.error("init param is not a str: " + BF);
180
if (tmp instanceof String) {
183
log.error("init param is not a str: " + FQ);