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

时间:2017-10-30 23:08:48

标签: java indexing marklogic marklogic-9

我们如何对路径范围查询进行不区分大小写的搜索? 我想对路径进行不区分大小写的搜索:

/pathSyntax = (case insensitive value of $Type)

路径范围搜索的示例查询格式,我需要将此路径范围查询搜索视为不区分大小写:我是否需要在为其创建的索引中进行更改?

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

以下是范围路径索引:

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

1 个答案:

答案 0 :(得分:3)

您可以使用不区分大小写的排序规则索引路径。

例如, 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"
}

根据查询的默认排序规则,您可能还需要在cts:path-range-query中将排序规则指定为选项:

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