Source Code Cross Referenced for DisMaxParams.java in  » Search-Engine » apache-solr-1.2.0 » org » apache » solr » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Search Engine » apache solr 1.2.0 » org.apache.solr.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */package org.apache.solr.util;
017:
018:        import org.apache.solr.core.SolrCore;
019:        import org.apache.solr.core.SolrInfoMBean;
020:        import org.apache.solr.core.SolrException;
021:
022:        import org.apache.solr.util.StrUtils;
023:        import org.apache.solr.util.NamedList;
024:
025:        import java.util.logging.Logger;
026:        import java.util.logging.Level;
027:        import java.util.logging.Handler;
028:
029:        import java.util.Arrays;
030:        import java.util.ArrayList;
031:        import java.util.List;
032:        import java.util.Collection;
033:        import java.util.Set;
034:        import java.util.HashSet;
035:        import java.util.Map;
036:        import java.util.HashMap;
037:        import java.util.regex.Pattern;
038:        import java.io.IOException;
039:
040:        /**
041:         * A collection of params used in DisMaxRequestHandler,
042:         * both for Plugin initialization and for Requests.
043:         */
044:        public class DisMaxParams extends CommonParams {
045:
046:            /** query and init param for tiebreaker value */
047:            public static String TIE = "tie";
048:            /** query and init param for query fields */
049:            public static String QF = "qf";
050:            /** query and init param for phrase boost fields */
051:            public static String PF = "pf";
052:            /** query and init param for MinShouldMatch specification */
053:            public static String MM = "mm";
054:            /**
055:             * query and init param for Phrase Slop value in phrase
056:             * boost query (in pf fields)
057:             */
058:            public static String PS = "ps";
059:            /**
060:             * query and init param for phrase Slop value in phrases
061:             * explicitly included in the user's query string ( in qf fields)
062:             */
063:            public static String QS = "qs";
064:            /** query and init param for boosting query */
065:            public static String BQ = "bq";
066:            /** query and init param for boosting functions */
067:            public static String BF = "bf";
068:            /**
069:             * Alternate query (expressed in Solr QuerySyntax)
070:             * to use if main query (q) is empty
071:             */
072:            public static String ALTQ = "q.alt";
073:            /** query and init param for filtering query
074:             * @deprecated use SolrParams.FQ or SolrPluginUtils.parseFilterQueries
075:             */
076:            public static String FQ = "fq";
077:            /** query and init param for field list */
078:            public static String GEN = "gen";
079:
080:            /**
081:             * the default tie breaker to use in DisjunctionMaxQueries
082:             * @deprecated - use explicit default with SolrParams.getFloat
083:             */
084:            public float tiebreaker = 0.0f;
085:            /**
086:             * the default query fields to be used
087:             * @deprecated - use explicit default with SolrParams.get
088:             */
089:            public String qf = null;
090:            /**
091:             * the default phrase boosting fields to be used
092:             * @deprecated - use explicit default with SolrParams.get
093:             */
094:            public String pf = null;
095:            /**
096:             * the default min should match to be used
097:             * @deprecated - use explicit default with SolrParams.get
098:             */
099:            public String mm = "100%";
100:            /**
101:             * the default phrase slop to be used 
102:             * @deprecated - use explicit default with SolrParams.getInt
103:             */
104:            public int pslop = 0;
105:            /**
106:             * the default boosting query to be used
107:             * @deprecated - use explicit default with SolrParams.get
108:             */
109:            public String bq = null;
110:            /**
111:             * the default boosting functions to be used
112:             * @deprecated - use explicit default with SolrParams.get
113:             */
114:            public String bf = null;
115:            /**
116:             * the default filtering query to be used
117:             * @deprecated - use explicit default with SolrParams.get
118:             */
119:            public String fq = null;
120:
121:            /**
122:             * Sets the params using values from a NamedList, usefull in the
123:             * init method for your handler.
124:             *
125:             * <p>
126:             * If any param is not of the expected type, a severe error is
127:             * logged,and the param is skipped.
128:             * </p>
129:             *
130:             * <p>
131:             * If any param is not of in the NamedList, it is skipped and the
132:             * old value is left alone.
133:             * </p>
134:             * @deprecated use SolrParams.toSolrParams
135:             */
136:            public void setValues(NamedList args) {
137:
138:                super .setValues(args);
139:
140:                Object tmp;
141:
142:                tmp = args.get(TIE);
143:                if (null != tmp) {
144:                    if (tmp instanceof  Float) {
145:                        tiebreaker = ((Float) tmp).floatValue();
146:                    } else {
147:                        SolrCore.log
148:                                .severe("init param is not a float: " + TIE);
149:                    }
150:                }
151:
152:                tmp = args.get(QF);
153:                if (null != tmp) {
154:                    if (tmp instanceof  String) {
155:                        qf = tmp.toString();
156:                    } else {
157:                        SolrCore.log.severe("init param is not a str: " + QF);
158:                    }
159:                }
160:
161:                tmp = args.get(PF);
162:                if (null != tmp) {
163:                    if (tmp instanceof  String) {
164:                        pf = tmp.toString();
165:                    } else {
166:                        SolrCore.log.severe("init param is not a str: " + PF);
167:                    }
168:                }
169:
170:                tmp = args.get(MM);
171:                if (null != tmp) {
172:                    if (tmp instanceof  String) {
173:                        mm = tmp.toString();
174:                    } else {
175:                        SolrCore.log.severe("init param is not a str: " + MM);
176:                    }
177:                }
178:
179:                tmp = args.get(PS);
180:                if (null != tmp) {
181:                    if (tmp instanceof  Integer) {
182:                        pslop = ((Integer) tmp).intValue();
183:                    } else {
184:                        SolrCore.log.severe("init param is not an int: " + PS);
185:                    }
186:                }
187:
188:                tmp = args.get(BQ);
189:                if (null != tmp) {
190:                    if (tmp instanceof  String) {
191:                        bq = tmp.toString();
192:                    } else {
193:                        SolrCore.log.severe("init param is not a str: " + BQ);
194:                    }
195:                }
196:
197:                tmp = args.get(BF);
198:                if (null != tmp) {
199:                    if (tmp instanceof  String) {
200:                        bf = tmp.toString();
201:                    } else {
202:                        SolrCore.log.severe("init param is not a str: " + BF);
203:                    }
204:                }
205:
206:                tmp = args.get(FQ);
207:                if (null != tmp) {
208:                    if (tmp instanceof  String) {
209:                        fq = tmp.toString();
210:                    } else {
211:                        SolrCore.log.severe("init param is not a str: " + FQ);
212:                    }
213:                }
214:
215:            }
216:
217:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.