Finished Java classes for search parsing
My two simple classes for parsing a Google-style search string and emitting XQuery clauses are now finished and tested; I've added extra features for handling redundant spaces, returns, and other deformities in the input, and everything seems to be working pretty well. The only slight difficulty is the problem of handling optional phrase matches; with mandatory phrases, we can use [contains(., "the phrase")], but with optional phrases (not preceded by +) we have to fall back to adding all the components of the phrase to a [. |= "the phrase and other stuff"] clause. This is not ideal, but I don't see a comparable XQuery clause I can use, and I don't want to break the system down any further. Another option would be to treat all phrases which are not minused ("must not contain") as being mandatory; we should consider that, or even make it a switch.
The next stage is to build the jar package, code links to it into the XQuery, and test it on a sandbox system that Greg is setting up, where we can mess with the XACML settings and turn on Java binding.