Hi, I need help with my Groovy script for Instant JChem.
I want to make a script to perform a text query. I'd seen tutorials about Groovy scripting and found this method (but...I suppose, this query is case sensitive).
q_org = DFTermsFactory.createFieldOperatorValueExpr(Operators.CONTAINS, fldOrganism, null, organism)
How could I rewrite it to make my query case insensitive. Is it possible?
...maybe you can tell me, where it's written about.
There is needed to define the third parameter in the function createFieldOperatorValueExpr.
You can see in documentation here, possible vaues for this parameter.
I can see in your code, that you let this parameter with value null. To define case-sensitivity or case-insensitivity you have to set the third parameter as Map with "query.option.caseInsensitiveSearch":true.
The code will be then st. like this:
def optionMap = [:]
q_org = DFTermsFactory.createFieldOperatorValueExpr(Operators.CONTAINS, fldOrganism, optionMap, organism)