001
014
015 package com.liferay.portal.kernel.search;
016
017 import java.util.Collection;
018 import java.util.List;
019 import java.util.Locale;
020 import java.util.Map;
021
022
029 @Deprecated
030 public class SearchEngineUtil extends SearchEngineHelperUtil {
031
032 @Deprecated
033 public static final String GENERIC_ENGINE_ID =
034 SearchEngineHelper.GENERIC_ENGINE_ID;
035
036 @Deprecated
037 public static final String SYSTEM_ENGINE_ID =
038 SearchEngineHelper.SYSTEM_ENGINE_ID;
039
040
045 @Deprecated
046 public static void addDocument(
047 String searchEngineId, long companyId, Document document)
048 throws SearchException {
049
050 IndexWriterHelperUtil.addDocument(
051 searchEngineId, companyId, document, false);
052 }
053
054
059 @Deprecated
060 public static void addDocument(
061 String searchEngineId, long companyId, Document document,
062 boolean commitImmediately)
063 throws SearchException {
064
065 IndexWriterHelperUtil.addDocument(
066 searchEngineId, companyId, document, commitImmediately);
067 }
068
069
074 @Deprecated
075 public static void addDocuments(
076 String searchEngineId, long companyId,
077 Collection<Document> documents)
078 throws SearchException {
079
080 IndexWriterHelperUtil.addDocuments(
081 searchEngineId, companyId, documents, false);
082 }
083
084
089 @Deprecated
090 public static void addDocuments(
091 String searchEngineId, long companyId,
092 Collection<Document> documents, boolean commitImmediately)
093 throws SearchException {
094
095 IndexWriterHelperUtil.addDocuments(
096 searchEngineId, companyId, documents, commitImmediately);
097 }
098
099
103 @Deprecated
104 public static void commit(String searchEngineId) throws SearchException {
105 IndexWriterHelperUtil.commit(searchEngineId);
106 }
107
108
112 @Deprecated
113 public static void commit(String searchEngineId, long companyId)
114 throws SearchException {
115
116 IndexWriterHelperUtil.commit(searchEngineId, companyId);
117 }
118
119
124 @Deprecated
125 public static void deleteDocument(
126 String searchEngineId, long companyId, String uid)
127 throws SearchException {
128
129 IndexWriterHelperUtil.deleteDocument(
130 searchEngineId, companyId, uid, false);
131 }
132
133
138 @Deprecated
139 public static void deleteDocument(
140 String searchEngineId, long companyId, String uid,
141 boolean commitImmediately)
142 throws SearchException {
143
144 IndexWriterHelperUtil.deleteDocument(
145 searchEngineId, companyId, uid, commitImmediately);
146 }
147
148
153 @Deprecated
154 public static void deleteDocuments(
155 String searchEngineId, long companyId, Collection<String> uids)
156 throws SearchException {
157
158 IndexWriterHelperUtil.deleteDocuments(
159 searchEngineId, companyId, uids, false);
160 }
161
162
167 @Deprecated
168 public static void deleteDocuments(
169 String searchEngineId, long companyId, Collection<String> uids,
170 boolean commitImmediately)
171 throws SearchException {
172
173 IndexWriterHelperUtil.deleteDocuments(
174 searchEngineId, companyId, uids, commitImmediately);
175 }
176
177
182 @Deprecated
183 public static void deleteEntityDocuments(
184 String searchEngineId, long companyId, String className,
185 boolean commitImmediately)
186 throws SearchException {
187
188 IndexWriterHelperUtil.deleteEntityDocuments(
189 searchEngineId, companyId, className, commitImmediately);
190 }
191
192
197 @Deprecated
198 public static void deletePortletDocuments(
199 String searchEngineId, long companyId, String portletId)
200 throws SearchException {
201
202 IndexWriterHelperUtil.deleteEntityDocuments(
203 searchEngineId, companyId, portletId, false);
204 }
205
206
210 @Deprecated
211 public static String getQueryString(
212 SearchContext searchContext, Query query) {
213
214 return IndexSearcherHelperUtil.getQueryString(searchContext, query);
215 }
216
217
222 @Deprecated
223 public static void indexKeyword(
224 long companyId, String querySuggestion, float weight,
225 String keywordType, Locale locale)
226 throws SearchException {
227
228 IndexWriterHelperUtil.indexKeyword(
229 companyId, querySuggestion, weight, keywordType, locale);
230 }
231
232
237 @Deprecated
238 public static void indexKeyword(
239 String searchEngineId, long companyId, String querySuggestion,
240 float weight, String keywordType, Locale locale)
241 throws SearchException {
242
243 IndexWriterHelperUtil.indexKeyword(
244 searchEngineId, companyId, querySuggestion, weight, keywordType,
245 locale);
246 }
247
248
252 @Deprecated
253 public static void indexQuerySuggestionDictionaries(long companyId)
254 throws SearchException {
255
256 IndexWriterHelperUtil.indexQuerySuggestionDictionaries(companyId);
257 }
258
259
264 @Deprecated
265 public static void indexQuerySuggestionDictionaries(
266 String searchEngineId, long companyId)
267 throws SearchException {
268
269 IndexWriterHelperUtil.indexQuerySuggestionDictionaries(
270 searchEngineId, companyId);
271 }
272
273
278 @Deprecated
279 public static void indexQuerySuggestionDictionary(
280 long companyId, Locale locale)
281 throws SearchException {
282
283 IndexWriterHelperUtil.indexQuerySuggestionDictionary(companyId, locale);
284 }
285
286
291 @Deprecated
292 public static void indexQuerySuggestionDictionary(
293 String searchEngineId, long companyId, Locale locale)
294 throws SearchException {
295
296 IndexWriterHelperUtil.indexQuerySuggestionDictionary(
297 searchEngineId, companyId, locale);
298 }
299
300
304 @Deprecated
305 public static void indexSpellCheckerDictionaries(long companyId)
306 throws SearchException {
307
308 IndexWriterHelperUtil.indexSpellCheckerDictionaries(companyId);
309 }
310
311
316 @Deprecated
317 public static void indexSpellCheckerDictionaries(
318 String searchEngineId, long companyId)
319 throws SearchException {
320
321 IndexWriterHelperUtil.indexSpellCheckerDictionaries(
322 searchEngineId, companyId);
323 }
324
325
330 @Deprecated
331 public static void indexSpellCheckerDictionary(
332 long companyId, Locale locale)
333 throws SearchException {
334
335 IndexWriterHelperUtil.indexSpellCheckerDictionary(companyId, locale);
336 }
337
338
343 @Deprecated
344 public static void indexSpellCheckerDictionary(
345 String searchEngineId, long companyId, Locale locale)
346 throws SearchException {
347
348 IndexWriterHelperUtil.indexSpellCheckerDictionary(
349 searchEngineId, companyId, locale);
350 }
351
352
356 @Deprecated
357 public static boolean isIndexReadOnly() {
358 return IndexWriterHelperUtil.isIndexReadOnly();
359 }
360
361
366 @Deprecated
367 public static void partiallyUpdateDocument(
368 String searchEngineId, long companyId, Document document,
369 boolean commitImmediately)
370 throws SearchException {
371
372 IndexWriterHelperUtil.partiallyUpdateDocument(
373 searchEngineId, companyId, document, commitImmediately);
374 }
375
376
381 @Deprecated
382 public static void partiallyUpdateDocuments(
383 String searchEngineId, long companyId,
384 Collection<Document> documents, boolean commitImmediately)
385 throws SearchException {
386
387 IndexWriterHelperUtil.partiallyUpdateDocuments(
388 searchEngineId, companyId, documents, commitImmediately);
389 }
390
391
395 @Deprecated
396 public static Hits search(SearchContext searchContext, Query query)
397 throws SearchException {
398
399 return IndexSearcherHelperUtil.search(searchContext, query);
400 }
401
402
406 @Deprecated
407 public static Hits search(
408 String searchEngineId, long companyId, Query query, int start,
409 int end)
410 throws SearchException {
411
412 return search(
413 searchEngineId, companyId, query, SortFactoryUtil.getDefaultSorts(),
414 start, end);
415 }
416
417
421 @Deprecated
422 public static Hits search(
423 String searchEngineId, long companyId, Query query, Sort sort,
424 int start, int end)
425 throws SearchException {
426
427 return search(
428 searchEngineId, companyId, query, new Sort[] {sort}, start, end);
429 }
430
431
435 @Deprecated
436 public static Hits search(
437 String searchEngineId, long companyId, Query query, Sort[] sorts,
438 int start, int end)
439 throws SearchException {
440
441 SearchContext searchContext = new SearchContext();
442
443 searchContext.setCompanyId(companyId);
444 searchContext.setEnd(end);
445 searchContext.setSearchEngineId(searchEngineId);
446 searchContext.setSorts(sorts);
447 searchContext.setStart(start);
448
449 return IndexSearcherHelperUtil.search(searchContext, query);
450 }
451
452
456 @Deprecated
457 public static long searchCount(SearchContext searchContext, Query query)
458 throws SearchException {
459
460 return IndexSearcherHelperUtil.searchCount(searchContext, query);
461 }
462
463
467 @Deprecated
468 public static void setIndexReadOnly(boolean readOnly) {
469 IndexWriterHelperUtil.setIndexReadOnly(readOnly);
470 }
471
472
476 @Deprecated
477 public static String spellCheckKeywords(SearchContext searchContext)
478 throws SearchException {
479
480 return IndexSearcherHelperUtil.spellCheckKeywords(searchContext);
481 }
482
483
488 @Deprecated
489 public static Map<String, List<String>> spellCheckKeywords(
490 SearchContext searchContext, int max)
491 throws SearchException {
492
493 return IndexSearcherHelperUtil.spellCheckKeywords(searchContext, max);
494 }
495
496
501 @Deprecated
502 public static String[] suggestKeywordQueries(
503 SearchContext searchContext, int max)
504 throws SearchException {
505
506 return IndexSearcherHelperUtil.suggestKeywordQueries(
507 searchContext, max);
508 }
509
510
515 @Deprecated
516 public static void updateDocument(
517 String searchEngineId, long companyId, Document document)
518 throws SearchException {
519
520 IndexWriterHelperUtil.updateDocument(
521 searchEngineId, companyId, document, false);
522 }
523
524
529 @Deprecated
530 public static void updateDocument(
531 String searchEngineId, long companyId, Document document,
532 boolean commitImmediately)
533 throws SearchException {
534
535 IndexWriterHelperUtil.updateDocument(
536 searchEngineId, companyId, document, commitImmediately);
537 }
538
539
544 @Deprecated
545 public static void updateDocuments(
546 String searchEngineId, long companyId,
547 Collection<Document> documents)
548 throws SearchException {
549
550 IndexWriterHelperUtil.updateDocuments(
551 searchEngineId, companyId, documents, false);
552 }
553
554
559 @Deprecated
560 public static void updateDocuments(
561 String searchEngineId, long companyId,
562 Collection<Document> documents, boolean commitImmediately)
563 throws SearchException {
564
565 IndexWriterHelperUtil.updateDocuments(
566 searchEngineId, companyId, documents, commitImmediately);
567 }
568
569
573 @Deprecated
574 public static void updatePermissionFields(String name, String primKey) {
575 IndexWriterHelperUtil.updatePermissionFields(name, primKey);
576 }
577
578 }