简体   繁体   English

Marklogic的Path Range Query中不区分大小写的搜索

[英]Case insensitive search in Path Range Query for Marklogic

How can we do case insensitive search for path range queries? 我们如何对路径范围查询进行不区分大小写的搜索? I want to make case insensitive search for path: 我想对路径进行不区分大小写的搜索:

/pathSyntax = (case insensitive value of $Type)

Sample Query Format for Path range search , I need to make this path range query search as case insensitive :, do I need to make changes in Indexes also created for it? 路径范围搜索的示例查询格式,我需要将此路径范围查询搜索视为不区分大小写:我是否需要在为其创建的索引中进行更改?

let $xyz:= cts:and-query((
 cts:collection-query(concat("xyz://", val, "/test")),
 cts:path-range-query("/pathSyntax", "=",$Type)
))

Below is range path index : 以下是范围路径索引:

{
  "scalar-type": "string",
  "path-expression": "/pathSyntax",
  "collation": "http://marklogic.com/collation/",
  "range-value-positions": false,
  "invalid-values": "reject"
},

You could index your path with a collation that is case-insensitive. 您可以使用不区分大小写的排序规则来索引路径。

For instance, http://marklogic.com/collation/en/S1 is a case/diacritic insensitive English character encoding, or http://marklogic.com/collation/en/S2 which is diacritic sensitive and may perform better. 例如, http://marklogic.com/collation/en/S1是一个案例/变音符号不敏感的英文字符编码,或http://marklogic.com/collation/en/S2 ,它是变音符号敏感的,可能表现更好。

{
  "scalar-type": "string",
  "path-expression": "/pathSyntax",
  "collation": "http://marklogic.com/collation/en/S1",
  "range-value-positions": false,
  "invalid-values": "reject"
}

Depending upon the default collation of your query, you may also need to specify the collation as an option in your cts:path-range-query : 根据查询的默认排序规则,您可能还需要在cts:path-range-query中将排序规则指定为选项:

cts:path-range-query("/pathSyntax", "=", $Type, "collation=http://marklogic.com/collation/en/S1")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM