I'm looking for a method that would sanitize search terms passed to elastic search, i.e. escape all the control characters. Something like what is described in Ruby in this answer. Is there such a thing for Scala?
There are provided libs for this that you're probably better off using
import org.apache.lucene.queryparser.classic.QueryParserBase
....
val escapedQ = QueryParserBase.escape(rawQuery)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With