0
votes
  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}}}

1
Please create separate SO questions for 2 and 3.. - grtjn
Sorry for delay, i have removed other 2 queries from above, will add separate queries - PALLAVI

1 Answers

0
votes

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.