Class LuceneUtils
java.lang.Object
org.owasp.dependencycheck.data.lucene.LuceneUtils
Lucene utils is a set of utilize written to make constructing Lucene queries simpler.
- Author:
- Jeremy Long
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendEscapedLuceneQuery(StringBuilder buf, CharSequence text) Appends the text to the supplied StringBuilder escaping Lucene control characters in the process.static StringEscapes the text passed in so that it is treated as data instead of control characters.static booleanDetermines if the given term is a Lucene keyword (e.g.
-
Method Details
-
isKeyword
Determines if the given term is a Lucene keyword (e.g. AND, OR, NOT).- Parameters:
term- the term to test- Returns:
trueif the term is a keyword; otherwisefalse
-
appendEscapedLuceneQuery
Appends the text to the supplied StringBuilder escaping Lucene control characters in the process.- Parameters:
buf- a StringBuilder to append the escaped text totext- the data to be escaped
-
escapeLuceneQuery
Escapes the text passed in so that it is treated as data instead of control characters.- Parameters:
text- data to be escaped- Returns:
- the escaped text.
-