In the meantime, I’ve just added to the script as we need to not have our results limited by stop words (e.g. “accounting and finance” ) AND allow partial queries (e.g. “chem” → “checmistry”):
...
def terms = q.query.tokenize(" ");
// something of a hack as we need to remove stop words from the query
// If there is a better way to fetch this list from the environment, please do.
// See: https://docs.funnelback.com/customise/advanced-options/stop-words.html
def stopWords = ["a", "a's", "able" ... "yourselves", "z", "zero"]
terms.each {
def term = it
if (stopWords.indexOf(term) > -1) {
terms -= term
}
}
...
terms.each {
Ideally, I’d rather check that this query processor option is set to 2, and if so fetch stop words rather than have them hard coded like this.
It is a bit hack-ish, I know, but it seems to work for this collection, for now. Still, open to better suggestions…