[MarkLogic Dev General] Wildcard Searches | MultiLingual Data | Cts Queries

Rahul Gupta rahul.gupta at nagarro.com
Tue Jan 12 09:21:19 PST 2016


Hi Team,

I am working on wildcard searches with multilingual data. I have enabled 3-character searches,  3 character word-positions, 2-character searches, trailing wildcard searches on database.

I have the following document:

<doc>
       <test xml:lang="zh">烧碱</test>
       <test xml:lang="en">Caustic Soda</test>
</doc>

Problem is that I want to get this document only if I search for “*Caus*” in “en” and not in “zh”.  ML is returning me the document even if I perform the following queries where “lang=zh” has been used. Also need to understand what this “lang” option actually does? Or is it a bug in MarkLogic?

cts:search(
fn:doc(),
  cts:element-value-query(xs:QName("test"), "Caus*", ("wildcarded","lang=zh")),
  "unfiltered")

cts:search(
  fn:doc(),
  cts:element-query(xs:QName("test"),
  cts:word-query("Caus* *", ("wildcarded","lang=zh"))),
  "unfiltered")

Can’t use path range queries since it doesn’t support wildcards. Any help would be much appreciated. Thanks in advance.

Thanks,
Rahul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20160112/597bcd39/attachment.html 


More information about the General mailing list