Class LuceneQueryUtil
- java.lang.Object
-
- com.atlassian.confluence.internal.search.v2.lucene.LuceneQueryUtil
-
public class LuceneQueryUtil extends Object
Utility class to help with creating queries. Also, useful for writing tests.- Since:
- 6.16.0
-
-
Constructor Summary
Constructors Constructor Description LuceneQueryUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
safeEscape(String query)
static Collection<String>
tokenize(org.apache.lucene.analysis.Analyzer analyzer, String field, String text)
NOTE:The ordering of tokens in the collection, is guaranteed to be in the order the text is processed.
-
-
-
Method Detail
-
tokenize
public static Collection<String> tokenize(org.apache.lucene.analysis.Analyzer analyzer, String field, String text)
NOTE:The ordering of tokens in the collection, is guaranteed to be in the order the text is processed. Duplicated tokens are allowed.e.g. "the quick brown fox the" guaranteed to be in the order {"the", "quick", "brown", "fox", "the"} if whitespace analysis is done.
For some use cases, it may also be useful to convert into an ordered set implementation, to avoid duplicates.
-
-