001
014
015 package com.liferay.portal.kernel.search.generic;
016
017 import com.liferay.portal.kernel.search.BaseQueryImpl;
018 import com.liferay.portal.kernel.search.query.QueryVisitor;
019
020
023 public class MatchQuery extends BaseQueryImpl {
024
025 public MatchQuery(String field, String value) {
026 _field = field;
027 _value = value;
028 }
029
030 @Override
031 public <T> T accept(QueryVisitor<T> queryVisitor) {
032 return queryVisitor.visitQuery(this);
033 }
034
035 public String getAnalyzer() {
036 return _analyzer;
037 }
038
039 public Float getCutOffFrequency() {
040 return _cutOffFrequency;
041 }
042
043 public String getField() {
044 return _field;
045 }
046
047 public Float getFuzziness() {
048 return _fuzziness;
049 }
050
051 public RewriteMethod getFuzzyRewriteMethod() {
052 return _fuzzyRewriteMethod;
053 }
054
055 public Integer getMaxExpansions() {
056 return _maxExpansions;
057 }
058
059 public String getMinShouldMatch() {
060 return _minShouldMatch;
061 }
062
063 public Operator getOperator() {
064 return _operator;
065 }
066
067 public Integer getPrefixLength() {
068 return _prefixLength;
069 }
070
071 public RewriteMethod getRewriteMethod() {
072 return _rewriteMethod;
073 }
074
075 public Integer getSlop() {
076 return _slop;
077 }
078
079 public Type getType() {
080 return _type;
081 }
082
083 public String getValue() {
084 return _value;
085 }
086
087 public ZeroTermsQuery getZeroTermsQuery() {
088 return _zeroTermsQuery;
089 }
090
091 public Boolean isFuzzyTranspositions() {
092 return _fuzzyTranspositions;
093 }
094
095 public Boolean isLenient() {
096 return _lenient;
097 }
098
099 public void setAnalyzer(String analyzer) {
100 _analyzer = analyzer;
101 }
102
103 public void setCutOffFrequency(Float cutOffFrequency) {
104 _cutOffFrequency = cutOffFrequency;
105 }
106
107 public void setFuzziness(Float fuzziness) {
108 _fuzziness = fuzziness;
109 }
110
111 public void setFuzzyRewriteMethod(RewriteMethod fuzzyRewriteMethod) {
112 _fuzzyRewriteMethod = fuzzyRewriteMethod;
113 }
114
115 public void setFuzzyTranspositions(Boolean fuzzyTranspositions) {
116 _fuzzyTranspositions = fuzzyTranspositions;
117 }
118
119 public void setLenient(Boolean lenient) {
120 _lenient = lenient;
121 }
122
123 public void setMaxExpansions(Integer maxExpansions) {
124 _maxExpansions = maxExpansions;
125 }
126
127 public void setMinShouldMatch(String minShouldMatch) {
128 _minShouldMatch = minShouldMatch;
129 }
130
131 public void setOperator(Operator operator) {
132 _operator = operator;
133 }
134
135 public void setPrefixLength(Integer prefixLength) {
136 _prefixLength = prefixLength;
137 }
138
139 public void setRewriteMethod(RewriteMethod rewriteMethod) {
140 _rewriteMethod = rewriteMethod;
141 }
142
143 public void setSlop(Integer slop) {
144 _slop = slop;
145 }
146
147 public void setType(Type type) {
148 _type = type;
149 }
150
151 public void setZeroTermsQuery(ZeroTermsQuery zeroTermsQuery) {
152 _zeroTermsQuery = zeroTermsQuery;
153 }
154
155 public enum Operator {
156
157 AND, OR
158
159 }
160
161 public enum RewriteMethod {
162
163 CONSTANT_SCORE_AUTO, CONSTANT_SCORE_BOOLEAN, CONSTANT_SCORE_FILTER,
164 SCORING_BOOLEAN, TOP_TERMS_N, TOP_TERMS_BOOST_N
165
166 }
167
168 public enum Type {
169
170 BOOLEAN, PHRASE, PHRASE_PREFIX
171
172 }
173
174 public enum ZeroTermsQuery {
175
176 ALL, NONE
177
178 }
179
180 private String _analyzer;
181 private Float _cutOffFrequency;
182 private final String _field;
183 private Float _fuzziness;
184 private RewriteMethod _fuzzyRewriteMethod;
185 private Boolean _fuzzyTranspositions;
186 private Boolean _lenient;
187 private Integer _maxExpansions;
188 private String _minShouldMatch;
189 private Operator _operator;
190 private Integer _prefixLength;
191 private RewriteMethod _rewriteMethod;
192 private Integer _slop;
193 private Type _type;
194 private final String _value;
195 private ZeroTermsQuery _zeroTermsQuery;
196
197 }