Jcr 使用反斜杠进行相等的SQL2查询 问题

Jcr 使用反斜杠进行相等的SQL2查询 问题,jcr,jcr-sql2,jackrabbit-oak,Jcr,Jcr Sql2,Jackrabbit Oak,我在属性somePath 当我对此属性执行SQL2查询时,如下图所示,我会得到结果: select * from [dam:Asset] as d where d.[jcr:content/metadata/somePath] = 'ABC' 但是,当我在这个查询中放置带有反斜杠的值时,它找不到任何结果,而元数据中有匹配项 select * from [dam:Asset] as d where d.[jcr:content/metadata/somePath] = 'F:\path\t

我在属性
somePath

当我对此属性执行SQL2查询时,如下图所示,我会得到结果:

select * from [dam:Asset] as d 
where d.[jcr:content/metadata/somePath] = 'ABC'
但是,当我在这个查询中放置带有反斜杠的值时,它找不到任何结果,而元数据中有匹配项

select * from [dam:Asset] as d 
where d.[jcr:content/metadata/somePath] =  'F:\path\to\somewhere.jpg' 
所有内容都已正确索引,并且索引正在使用(在解释查询中可见)

试用 逃生操作员-故障 我已经尝试使用LIKE命令中的ESCAPE操作符,但这对于简单的相等操作符不起作用

退出反斜杠(JCR SQL2)-失败 当我像在一些黑暗的jcr sql2文档(')中一样试图避开反斜杠时,我也没有得到任何结果:

select * from [dam:Asset] as d 
where d.[jcr:content/metadata/somePath] =  "F:'\path'\to'\somewhere.jpg" 
select * from [dam:Asset] as d 
where d.[jcr:content/metadata/somePath] =  'F:\\path\\to\\somewhere.jpg' 
转义反斜杠(Java样式)-失败 当我尝试转义反斜杠java样式时,也没有得到任何结果:

select * from [dam:Asset] as d 
where d.[jcr:content/metadata/somePath] =  "F:'\path'\to'\somewhere.jpg" 
select * from [dam:Asset] as d 
where d.[jcr:content/metadata/somePath] =  'F:\\path\\to\\somewhere.jpg' 
URL编码反斜杠-失败 对字符串应用URL编码,无结果:

select * from [dam:Asset] as d 
where d.[jcr:content/metadata/somePath] =  'F:%5Cpath%5Cto%5Csomewhere.jpg'
select * from [dam:Asset] as d 
where d.[jcr:content/metadata/somePath] =  CAST('F:\path\to\somewhere.jpg' AS STRING)
使用方括号转义任何字符-失败 将值用方括号括起来,就像where子句左操作数一样,无结果(带引号和不带引号):

将值强制转换为字符串-失败 将值显式强制转换为字符串,无结果:

select * from [dam:Asset] as d 
where d.[jcr:content/metadata/somePath] =  'F:%5Cpath%5Cto%5Csomewhere.jpg'
select * from [dam:Asset] as d 
where d.[jcr:content/metadata/somePath] =  CAST('F:\path\to\somewhere.jpg' AS STRING)
使用“包含”操作符-解决方法 当我使用CONTAINS时,我确实会得到结果,但如果可能的话,我希望避免这种情况

select * from [dam:Asset] as d 
where ISDESCENDANTNODE(d, '/content/dam') AND CONTAINS(d.* , 'F:\path\to\somewhere.jpg')

关于SQL2如何使用反斜杠处理属性值有什么想法吗

您在哪里使用查询?Java,JS。。。我尝试使用crxde查询工具和acs工具解释查询。两者都没有转义。您在哪里使用查询?Java,JS。。。我尝试使用crxde查询工具和acs工具解释查询。两人都没有逃跑。