Is there any way to create a custom constraint where the right part can include complex logic? i.e.
name:(phil OR tom)
In my function, when I get the $right side, the whole value has been reduced to a simple concatenated string of all of the text, i.e.
<cts:word-query xmlns:cts="http://marklogic.com/cts">
<cts:text>phil tom</cts:text>
</cts:word-query>
What I am looking to do is to take a parsed query and then add my own additions to the parsed query. So I was hoping that there was some way to get the $right parameter to be something like
<cts:or-query xmlns:cts="http://marklogic.com/cts">
<cts:word-query>
<cts:text>phil</cts:text>
</cts:word-query>
<cts:word-query>
<cts:text>tom</cts:text>
</cts:word-query>
</cts:or-query>
I want to take the output results of the query and expand with another query to get the real results. i.e. I have a name
constraint which restricts search to various name fields. After finding the matching people, I want to turn the results into a hierarchy of people from the matching people, maybe 2 levels down. This does not seem to make sense as a transform result or a custom constraint. Would this just be a custom REST endpoint? I was hoping to make use of the paging already built into the standard search endpoint.