Source Code Cross Referenced for StringSearchConstraint.java in  » Database-ORM » MMBase » org » mmbase » storage » search » 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 » Database ORM » MMBase » org.mmbase.storage.search 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:        This software is OSI Certified Open Source Software.
004:        OSI Certified is a certification mark of the Open Source Initiative.
005:
006:        The license (Mozilla version 1.0) can be read at the MMBase site.
007:        See http://www.MMBase.org/license
008:
009:         */
010:        package org.mmbase.storage.search;
011:
012:        import java.util.*;
013:
014:        /**
015:         * A constraint specifically for advanced types of text searches.
016:         * <p>
017:         * In addition to searchterms, a <em>search type</em> and a
018:         * <em>match type</em> can be specified:
019:         * <p>
020:         * The search type specifies how the search is performed:
021:         * Must be one of:
022:         * <ul>
023:         * <li>{@link #SEARCH_TYPE_WORD_ORIENTED SEARCH_TYPE_WORD_ORIENTED}
024:         *  - searches for the most occurrences of the words in the search terms.
025:         *    Order and proximity of words is not significant.
026:         * <li>{@link #SEARCH_TYPE_PHRASE_ORIENTED SEARCH_TYPE_PHRASE_ORIENTED}
027:         *  - searches for occurrence of the sequence of words in the search terms.
028:         * <li>{@link #SEARCH_TYPE_PROXIMITY_ORIENTED SEARCH_TYPE_PROXIMITY_ORIENTED}
029:         *  - searches for the most occurrences of the words within a given
030:         *    word distance.
031:         *    Order of words is not important.
032:         * </ul>
033:         * <p>
034:         * The match type specifies how individual words in the
035:         * search terms are matched with words in the searched text.
036:         * <ul>
037:         * <li>{@link #MATCH_TYPE_LITERAL MATCH_TYPE_LITERAL}
038:         *  - exact match only
039:         * <li>{@link #MATCH_TYPE_FUZZY MATCH_TYPE_FUZZY}
040:         *  - fuzzy match: matches words within the specified number of
041:         *    typo's as well (specified by parameter <code>PARAM_FUZZINESS</code>)
042:         * <li>{@link #MATCH_TYPE_SYNONYM MATCH_TYPE_SYNONYM}
043:         *  - matches synonyms as well
044:         * </ul>
045:         * <p>
046:         * The searchterms may containt the following wildchard characters as well:
047:         * <ul>
048:         * <li>% for any string
049:         * <li>_ for a single character
050:         * </ul>
051:         * <p>
052:         * Depending on searchtype and searchmode, the following parameters
053:         * can be set:
054:         * <ul>
055:         * <li>{@link #PARAM_FUZZINESS PARAM_FUZZINESS}
056:         *  - <code>Float</code>, specifies maximum allowed number of
057:         *    typo's per word, expressed as fraction of word length.
058:         *    (E.g. 0,2 means: maximum 2 typo's for 10 letter words.).<br />
059:         *    This parameter is only relevant when used with match type
060:         *    <code>MATCH_TYPE_FUZZY</code>.
061:         *    It can only be set for this match type, and is cleared when
062:         *    the match type is set to another value.
063:         * <li>{@link #PARAM_PROXIMITY_LIMIT PARAM_PROXIMITY_LIMIT}
064:         *  - <code>Integer</code>, specifies maximum distance between
065:         *    searched words.<br />
066:         *    This parameter is only relevant when used with search type
067:         *    <code>SEARCH_TYPE_PROXIMITY_ORIENTED</code>.
068:         *    It can only be set for this search type, and is cleared when
069:         *    the search type is set to another value.
070:         * </ul>
071:         *
072:         * @author Rob van Maris
073:         * @version $Id: StringSearchConstraint.java,v 1.5 2007/02/24 21:57:50 nklasens Exp $
074:         * @since MMBase-1.7
075:         */
076:        public interface StringSearchConstraint extends FieldConstraint {
077:
078:            /** Search type for <em>word oriented</em> search. */
079:            public final static int SEARCH_TYPE_WORD_ORIENTED = 1;
080:
081:            /** Search type for <em>phrase oriented</em> search. */
082:            public final static int SEARCH_TYPE_PHRASE_ORIENTED = 2;
083:
084:            /** Search type for <em>proximity oriented</em> search. */
085:            public final static int SEARCH_TYPE_PROXIMITY_ORIENTED = 3;
086:
087:            /**
088:             * Search type descriptions corresponding to the search type values:
089:             * {@link #SEARCH_TYPE_WORD_ORIENTED}, {@link #SEARCH_TYPE_PHRASE_ORIENTED}, and
090:             * {@link #SEARCH_TYPE_PROXIMITY_ORIENTED}
091:             */
092:            String[] SEARCH_TYPE_DESCRIPTIONS = new String[] { null, // not specified
093:                    "word oriented", "phrase oriented", "proximity oriented" };
094:
095:            /** Match type for <em>literal</em> matching. */
096:            public final static int MATCH_TYPE_LITERAL = 1;
097:
098:            /** Match type for <em>fuzzy</em> matching. */
099:            public final static int MATCH_TYPE_FUZZY = 2;
100:
101:            /** Match type for <em>synonym</em> matching. */
102:            public final static int MATCH_TYPE_SYNONYM = 3;
103:
104:            /**
105:             * Match type descriptions corresponding to the match type values:
106:             * {@link #MATCH_TYPE_LITERAL}, {@link #MATCH_TYPE_FUZZY}, and
107:             * {@link #MATCH_TYPE_SYNONYM}
108:             */
109:            public final static String[] MATCH_TYPE_DESCRIPTIONS = new String[] {
110:                    null, // not specified
111:                    "literal", "fuzzy", "synonym" };
112:
113:            /** Name for parameter specifying <em>fuzziness</em> for fuzzy matching. */
114:            public final static String PARAM_FUZZINESS = "fuzziness";
115:
116:            /**
117:             * Name for parameter specifying <em>proximity limit</em> for
118:             * proximity oriented search.
119:             */
120:            public final static String PARAM_PROXIMITY_LIMIT = "proximityLimit";
121:
122:            /**
123:             * Gets the search type, this specifies how the search is performed.
124:             */
125:            int getSearchType();
126:
127:            /**
128:             * Gets value of additional parameters.
129:             *
130:             * @return The parameters, as an unmodifiable Map.
131:             */
132:            Map<String, Object> getParameters();
133:
134:            /**
135:             * Gets the match type.
136:             */
137:            int getMatchType();
138:
139:            /**
140:             * Gets the list of searchterms.
141:             *
142:             * @return The searchterms, as an unmodifiable List.
143:             */
144:            List<String> getSearchTerms();
145:
146:            /**
147:             * Returns a string representation of this StringSearchConstraint.
148:             * The string representation has the form
149:             * "StringSearchConstraint(inverse:&lt:inverse&gt;, field:&lt;field&gt;,
150:             *  casesensitive:&lt;casesensitive&gt;, searchtype:&lt;searchtype&gt;,
151:             *  matchtype:&lt;matchtype&gt;, parameters:&lt;parameters&gt;,
152:             *  searchterms:&lt;searchterms&gt;)"
153:             * where
154:             * <ul>
155:             * <li><em>&lt;inverse&gt;</em>is the value returned by
156:             *      {@link #isInverse isInverse()}
157:             * <li><em>&lt;field&gt;</em> is the field alias returned by
158:             *     <code>getField().getAlias()</code>
159:             * <li><em>&lt;casesensitive&gt;</em> is the value returned by
160:             *     {@link FieldConstraint#isCaseSensitive isCaseSensitive()}
161:             * <li><em>&lt;searchtype&gt;</em> is the value returned by
162:             *     {@link StringSearchConstraint#getSearchType getSearchType()}
163:             * <li><em>&lt;matchtype&gt;</em> is the value returned by
164:             *     {@link StringSearchConstraint#getMatchType getMatchType()}
165:             * <li><em>&lt;parameters&gt;</em> is the map returned by
166:             *     {@link StringSearchConstraint#getParameters getParameters()}
167:             * <li><em>&lt;searchterms&gt;</em> is the list returned by
168:             *     {@link StringSearchConstraint#getSearchTerms getParameters()}
169:             *
170:             * @return A string representation of this FieldValueConstraint.
171:             */
172:            public String toString();
173:
174:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.