Lucene query : parse execption



我正在使用露天并尝试执行这些查询,

这些是我的疑问。

第一:

PATH:"/app:company_home/st:sites/cm:swsdp/cm:dataLists/cm:aea88103-517e-4aa0-a3be-de258d0e6465//*">

第一个查询工作正常,但第二个查询无法解析

第二

+PATH:"/app:company_home/st:swsdp/cm:/cm:dataLists/cm:9787a75b-cbc9-4d42-b76c-df88461e62c6//*">

例外: 无法解析 '+PATH:"/app:company_home/st:swsdp/cm:/cm:dataLists/cm:9787a75b-cbc9-4d42-b76c-df88461e62c6//*" 和 +TYPE:"fdm:formDatalist"': 无法解析 XPath... 意外的"9787">

我试图逃跑,但仍然得到同样的。

+PATH:"/app:company_home/st:swsdp/cm:/cm:dataLists/cm:9787a75b\-cbc9\-4d42-b76c\-df88461e62c6//

我注意到在第一个查询中 cm:aea88103-517e-4aa0-a3be-de258d0e6465以后者开头,但在第二个查询中cm:9787a75b-cbc9-4d42-b76c-df88461e62c6它在开头包含数字,因此无法解析。

请解决此错误。

对于 lucene PATH 查询,某些字符需要以 six 编码。

您需要以这种方式对路径进行编码:

var rawString = "//test:123 DIR/FILE.TXT @"; 
=> rawString: //test:123 DIR/FILE.TXT @   
var encodedString = search.ISO9075Encode(rawString);
=> encodedString: _x002f__x002f_test_x003a_123_x0020_DIR_x002f_FILE.TXT_x0020__x0040_
var decodedString = search.ISO9075Decode(encodedString);
=> decodedString: //test:123 DIR/FILE.TXT @  

查看露天文档以获取更多信息:http://docs.alfresco.com/5.2/references/API-JS-iso9075Encode.html

最新更新