0
  1. I am exploring the MarkLogic QBE (query by example) API and in that would like to check how can i find the JSON documents which has "Name" key starts with some keyword such as "Hello*"? We can have $value parameter in QBE query for exact value match and $word parameter in QBE query for contain feature. But i want to use it for the feature of starts with functionality using wildcarded option in QBE . I have enabled 'trailing wildcard searches' index for database and also created field and field range index on "Name". e.g.below query sample should return the result set with json documents which has Name starts with Hello and not contains Hello word
https://Server:port/v1/qbe?format=json&pageLength=10&start=1&options=search_option_advanced&directory=/json/&query={"$query":{"Name":{"$word":["Hello*"],"$exact":false,"$case-sensitive":false}}}

PALLAVI
  • 21
  • 7

1 Answers1

0

The query looks like it should work if Name is a JSON property and you've enabled wildcard searches for that property as described in:

http://docs.marklogic.com/guide/search-dev/wildcard#id_39731

If wildcard search is configured correctly but wildcard search isn't working in QBE, please file a support ticket.

So far as I know, wildcard searches don't work against range indexes. The server does support value match lookups against a range index, but that's not a query.

ehennum
  • 7,295
  • 13
  • 9
  • if possible could you please elaborate more on "wildcard searches don't work against range indexes." – PALLAVI Jun 04 '19 at 08:57
  • Also from my QA server settings tried creating Support Request but did not worked, as mentioned in https://help.marklogic.com/Knowledgebase/Article/View/13/19/creating-a-support-request – PALLAVI Jun 04 '19 at 09:07
  • My understanding is that word and value queries can take wildcard criteria after wildcard indexes have been enabled. Range indexes support exact matches and value lookup. See http://docs.marklogic.com/guide/search-dev/wildcard – ehennum Jun 04 '19 at 16:23