Search code examples
marklogic

Why don't I get suggestions with a multi-term partial query?


I have an authors range constraint based on a path range index. The values are strings, with the index using the "http://marklogic.com/collation/en/S1" collation.

When I call cts.values on that pathReference, I see values like "Smith, A.", "Smith, B.", "Smith, A. B." etc. I can also use the /v1/suggest endpoint with a partial-q parameter of "Authors:Smith" and I'll get back all the expected values.

However, if I want to narrow it down more by including a first initial in the partial-q, I figure need to enclose the value in quotes (partial-q=Authors:"Smith, A"), but if I do that I get no results (successful query; no values). In fact, as soon as I add quotes (partial-q=Authors:"Smith") I stop getting results.

Does /v1/suggest support this kind of query?


Solution

  • I agree it is not very obvious, but you need to drop the closing quote, so that MarkLogic knows the string value is not finished yet. So you send: partial-q=Authors:"Smith, A

    HTH!