AnsweredAssumed Answered

SearchParamters ParseException

Question asked by mtw999 on Jun 13, 2014
Latest reply on Jun 13, 2014 by kaynezhang
Hello,

I have two queries I'm using with SearchParameters. I'm having issue figuring out how to query for a specific property:

General question, what is the best way to test query to know that it is formatted correctly to work as query provided to SearchParameters? NodeBrowser does not work as both these queries execute successfully in Node Browser:

How do I specify a property search in a query passed to SearchParameters.query() and what exactly is this error telling me:
Encountered " ":" ": "" at line 1, column 132


Successful:
PATH:"./app:company_home/st:sites/cm:%s/cm:documentLibrary//*" AND TYPE:"mytype:mydoc" AND ISNOTNULL:"mydoc:myCode"

Resolves to:
PATH:"./app:company_home/st:sites/cm:submissions/cm:documentLibrary//*" AND TYPE:"mytype:mydoc" AND ISNOTNULL:"mydoc:myCode"

Fails:
PATH:"./app:company_home/st:sites/cm:%s/cm:documentLibrary//*" AND TYPE:"mytype:mydoc" AND
mydoc:myCode:%s

Resolves to
PATH:"./app:company_home/st:sites/cm:submissions/cm:documentLibrary//*" AND TYPE:"mytype:mydoc" AND mydoc:myCode:foo

Also tried:
PATH:"./app:company_home/st:sites/cm:submissions/cm:documentLibrary//*" AND TYPE:"mytype:mydoc" AND mydoc:myCode:"foo"

Error on failure(s):
org.apache.solr.common.SolrException: org.apache.lucene.queryParser.ParseException: Cannot parse 'PATH:"./app:company_home/st:sites/cm:mySite/cm:documentLibrary//*" AND TYPE:"mytype:mydoc" AND mydoc:myCode:foo': Encountered " ":" ": "" at line 1, column 132.
Was expecting one of:


Thanks,

Mike

Outcomes