~slub.team/goobi-indexserver/3.x

« back to all changes in this revision

Viewing changes to solr/core/src/java/org/apache/solr/util/DisMaxParams.java

  • Committer: Sebastian Meyer
  • Date: 2012-08-03 09:12:40 UTC
  • Revision ID: sebastian.meyer@slub-dresden.de-20120803091240-x6861b0vabq1xror
Remove Lucene and Solr source code and add patches instead
Fix Bug #985487: Auto-suggestion for the search interface

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
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
8
 
 *
9
 
 *     http://www.apache.org/licenses/LICENSE-2.0
10
 
 *
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.
16
 
 */
17
 
 
18
 
package org.apache.solr.util;
19
 
 
20
 
import org.slf4j.Logger;
21
 
import org.slf4j.LoggerFactory;
22
 
 
23
 
import org.apache.solr.common.util.NamedList;
24
 
 
25
 
/**
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.
28
 
 */
29
 
@Deprecated
30
 
public class DisMaxParams extends CommonParams implements org.apache.solr.common.params.DisMaxParams {
31
 
 
32
 
  public static Logger log = LoggerFactory.getLogger(DisMaxParams.class);
33
 
 
34
 
 
35
 
  /** query and init param for filtering query
36
 
   * @deprecated use SolrParams.FQ or SolrPluginUtils.parseFilterQueries
37
 
   */
38
 
  @Deprecated
39
 
  public static String FQ = "fq";
40
 
  
41
 
  /**
42
 
   * the default tie breaker to use in DisjunctionMaxQueries
43
 
   * @deprecated - use explicit default with SolrParams.getFloat
44
 
   */
45
 
  @Deprecated
46
 
  public float tiebreaker = 0.0f;
47
 
  /**
48
 
   * the default query fields to be used
49
 
   * @deprecated - use explicit default with SolrParams.get
50
 
   */
51
 
  @Deprecated
52
 
  public String qf = null;
53
 
  /**
54
 
   * the default phrase boosting fields to be used
55
 
   * @deprecated - use explicit default with SolrParams.get
56
 
   */
57
 
  @Deprecated
58
 
  public String pf = null;
59
 
  /**
60
 
   * the default min should match to be used
61
 
   * @deprecated - use explicit default with SolrParams.get
62
 
   */
63
 
  @Deprecated
64
 
  public String mm = "100%";
65
 
  /**
66
 
   * the default phrase slop to be used 
67
 
   * @deprecated - use explicit default with SolrParams.getInt
68
 
   */
69
 
  @Deprecated
70
 
  public int pslop = 0;
71
 
  /**
72
 
   * the default boosting query to be used
73
 
   * @deprecated - use explicit default with SolrParams.get
74
 
   */
75
 
  @Deprecated
76
 
  public String bq = null;
77
 
  /**
78
 
   * the default boosting functions to be used
79
 
   * @deprecated - use explicit default with SolrParams.get
80
 
   */
81
 
  @Deprecated
82
 
  public String bf = null;
83
 
  /**
84
 
   * the default filtering query to be used
85
 
   * @deprecated - use explicit default with SolrParams.get
86
 
   */
87
 
  @Deprecated
88
 
  public String fq = null;
89
 
 
90
 
 
91
 
  /**
92
 
   * Sets the params using values from a NamedList, usefull in the
93
 
   * init method for your handler.
94
 
   *
95
 
   * <p>
96
 
   * If any param is not of the expected type, a severe error is
97
 
   * logged,and the param is skipped.
98
 
   * </p>
99
 
   *
100
 
   * <p>
101
 
   * If any param is not of in the NamedList, it is skipped and the
102
 
   * old value is left alone.
103
 
   * </p>
104
 
   * @deprecated use SolrParams.toSolrParams
105
 
   */
106
 
  @Override
107
 
  @Deprecated
108
 
  public void setValues(NamedList args) {
109
 
 
110
 
    super.setValues(args);
111
 
 
112
 
    Object tmp;
113
 
 
114
 
    tmp = args.get(TIE);
115
 
    if (null != tmp) {
116
 
      if (tmp instanceof Float) {
117
 
        tiebreaker = ((Float)tmp).floatValue();
118
 
      } else {
119
 
        log.error("init param is not a float: " + TIE);
120
 
      }
121
 
    }
122
 
 
123
 
    tmp = args.get(QF);
124
 
    if (null != tmp) {
125
 
      if (tmp instanceof String) {
126
 
        qf = tmp.toString();
127
 
      } else {
128
 
        log.error("init param is not a str: " + QF);
129
 
      }
130
 
    }
131
 
 
132
 
    tmp = args.get(PF);
133
 
    if (null != tmp) {
134
 
      if (tmp instanceof String) {
135
 
        pf = tmp.toString();
136
 
      } else {
137
 
        log.error("init param is not a str: " + PF);
138
 
      }
139
 
    }
140
 
 
141
 
        
142
 
    tmp = args.get(MM);
143
 
    if (null != tmp) {
144
 
      if (tmp instanceof String) {
145
 
        mm = tmp.toString();
146
 
      } else {
147
 
        log.error("init param is not a str: " + MM);
148
 
      }
149
 
    }
150
 
        
151
 
    tmp = args.get(PS);
152
 
    if (null != tmp) {
153
 
      if (tmp instanceof Integer) {
154
 
        pslop = ((Integer)tmp).intValue();
155
 
      } else {
156
 
        log.error("init param is not an int: " + PS);
157
 
      }
158
 
    }
159
 
 
160
 
    tmp = args.get(BQ);
161
 
    if (null != tmp) {
162
 
      if (tmp instanceof String) {
163
 
        bq = tmp.toString();
164
 
      } else {
165
 
        log.error("init param is not a str: " + BQ);
166
 
      }
167
 
    }
168
 
 
169
 
    tmp = args.get(BF);
170
 
    if (null != tmp) {
171
 
      if (tmp instanceof String) {
172
 
        bf = tmp.toString();
173
 
      } else {
174
 
        log.error("init param is not a str: " + BF);
175
 
      }
176
 
    }
177
 
 
178
 
    tmp = args.get(FQ);
179
 
    if (null != tmp) {
180
 
      if (tmp instanceof String) {
181
 
        fq = tmp.toString();
182
 
      } else {
183
 
        log.error("init param is not a str: " + FQ);
184
 
      }
185
 
    }
186
 
                
187
 
  }
188
 
 
189
 
}