Alfresco FTS - why first digit of folder's name should be escaped?

353 views Asked by At

I have a question regarding the alfresco FTS/lucene search. It is known that in the search query some special characters have to be escaped, like space (by _x0020_).

But it turned out that if folder's name first chatacter is a digit, it should also be escaped. It can be easily tested in Node Browser by creating a folder, like 123456 and navigate to the parent folder in node browser (in my case I have following folder structure: */2017/123456/):

Primary Path: /app:company_home/st:sites/<some-folders>/cm:_x0032_017/cm:_x0031_23456
                                                            ^this is 2    ^ and this is 1

If I don't ecape first character of the folder I have 500 error returned.

Why is that, I tried to find something relevant in Alfresco documentation, but didn't manage to.

Alfresco v.4.2.0

1

There are 1 answers

0
Heiko Robert On BEST ANSWER

Lucene search uses ISO 9075 codification (SQL) like similar frameworks, so we need to encode the path elements. It would be nice if the API hides this requirement like the browser url but you could use ISO9075Encode to do the job.