@ThreadSafe public final class LuceneUtils extends Object
Lucene utils is a set of utilize written to make constructing Lucene queries simpler.
| Modifier and Type | Method and Description |
|---|---|
static void |
appendEscapedLuceneQuery(StringBuilder buf,
CharSequence text)
Appends the text to the supplied StringBuilder escaping Lucene control
characters in the process.
|
static String |
escapeLuceneQuery(CharSequence text)
Escapes the text passed in so that it is treated as data instead of
control characters.
|
static boolean |
isKeyword(String term)
Determines if the given term is a Lucene keyword (e.g.
|
public static boolean isKeyword(String term)
term - the term to testtrueif the term is a keyword; otherwise
falsepublic static void appendEscapedLuceneQuery(StringBuilder buf, CharSequence text)
buf - a StringBuilder to append the escaped text totext - the data to be escapedpublic static String escapeLuceneQuery(CharSequence text)
text - data to be escapedCopyright © 2012–2020 OWASP. All rights reserved.