I have an issue with running an XQuery on eXist-db. I have an application that runs on Tomcat and sends queries to eXist-db, to find certain files. The query that is generated and sent is like this (I use ~
for fuzzy search):
for $doc in collection('/db')//document/sender[ft:query(.,'test~')]
let $score := ft:score($doc)
order by $score descending
return
base-uri($doc)
and I get the following error on the test server:
org.exist.xquery.XPathException: exerr:ERROR Syntax error in Lucene query
string: Cannot parse 'test~': Encountered " <FUZZY_SLOP> "~ "" at line 1, column 10.
Was expecting one of:
<EOF>
<AND> ...
<OR> ...
<NOT> ...
"+" ...
"-" ...
<BAREOPER> ...
"(" ...
"*" ...
"^" ...
<QUOTED> ...
<TERM> ...
<PREFIXTERM> ...
<WILDTERM> ...
<REGEXPTERM> ...
"[" ...
"{" ...
<NUMBER> ...
However, when I run the same query on my local machine, I do not get that error and instead I get the expected results. What am I missing?