I have a registered query token id in MarkLogic database and I am wondering if we can do a look up of particular value existence of the query value.
I need to know if my input value is present in the registered query or not without running any cts:search
with the registered token id.
If you are just wanting to see if anything in the database matches your registered query, you can use
xdmp:estimate()
around your search - it will tell you how many fragments match the query. Some work is done, but only related to new or changed fragments since the actual query was last run.If you are saying "given a certain value in memory, will it match a registered query", then the answer is no. However, registered queries are persisted as a soft state only - so they can expire in 2-3 different ways - making a token eventually no longer valid. It is for this reason that most strategies related to registered queries include a way to refresh the query such as re-register before use or try/catch. In all cases, to protect against a registered query expiring, you would likely have the full
cts:query
available. If that is the case, then you could usects:contains(your-value, your cts-query)
.