Expand my Community achievements bar.

QueryBuilder returning different results than XPath "debugger" for Chinese character search

Avatar

Level 3

I am using QueryBuilder to do a search.  It works with Latin characters, but as soon as I do a search with Chinese characters it is not returning any results.  I turned on logging for com.day.cq.search which allowed me to pull the XPath query that it is attempting to run.  The weirder thing is that when I copy that query over to http://localhost:4502/crx/explorer/ui/search.jsp (the "debugger") and use that, it pulls back three results.  Would appreciate any help that anyone could provide.  For what it's worth we are on AEM 6.1, SP 1.  I will provide a log a Chinese search (that only works in the "debugger") and log for the English version of the Chinese search that works in both places.

Chinese

21.10.2016 09:28:23.256 *DEBUG* [0:0:0:0:0:0:0:1 [1477056502708] GET /content/staging-china-chinese/search-results.html HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl executing query (URL): fulltext=RC%c3%a7%c2%b3%c2%bb%c3%a5%cb%86%e2%80%94&group.p.or=true&orderByScore=%40jcr%3ascore&orderByScore.sort=desc&p.excerpt=true&p.limit=10&p.offset=0&resultTypes.type=&type=nt%3ahierarchyNode 21.10.2016 09:28:23.256 *DEBUG* [0:0:0:0:0:0:0:1 [1477056502708] GET /content/staging-china-chinese/search-results.html HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl executing query (predicate tree): ROOT=group: limit=10, offset=0, excerpt=true[ {fulltext=fulltext: fulltext=RC系列} {group=group: or=true[ ]} {type=type: type=nt:hierarchyNode} {resultTypes=searchResultType: type=null} {orderByScore=orderby: orderby=@jcr:score, sort=desc} ] 21.10.2016 09:28:23.257 *DEBUG* [0:0:0:0:0:0:0:1 [1477056502708] GET /content/staging-china-chinese/search-results.html HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl xpath query: //element(*, nt:hierarchyNode)[jcr:contains(., 'RC系列') and @jcr:primaryType = 'cq:Page']/rep:excerpt(.) order by @jcr:score descending 21.10.2016 09:28:23.258 *DEBUG* [0:0:0:0:0:0:0:1 [1477056502708] GET /content/staging-china-chinese/search-results.html HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl xpath query creation took 2 ms 21.10.2016 09:28:23.263 *DEBUG* [0:0:0:0:0:0:0:1 [1477056502708] GET /content/staging-china-chinese/search-results.html HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl >> xpath query returned 0 results (getSize) 21.10.2016 09:28:23.300 *DEBUG* [0:0:0:0:0:0:0:1 [1477056502708] GET /content/staging-china-chinese/search-results.html HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl entire query execution took 44 ms

English

21.10.2016 10:01:05.155 *DEBUG* [0:0:0:0:0:0:0:1 [1477058464602] GET /content/en-us/search-results.html HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl executing query (URL): fulltext=RC%20Series&group.p.or=true&orderByScore=%40jcr%3ascore&orderByScore.sort=desc&p.excerpt=true&p.limit=10&p.offset=0&resultTypes.type=&type=nt%3ahierarchyNode 21.10.2016 10:01:05.155 *DEBUG* [0:0:0:0:0:0:0:1 [1477058464602] GET /content/en-us/search-results.html HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl executing query (predicate tree): ROOT=group: limit=10, offset=0, excerpt=true[ {fulltext=fulltext: fulltext=RC Series} {group=group: or=true[ ]} {type=type: type=nt:hierarchyNode} {resultTypes=searchResultType: type=null} {orderByScore=orderby: orderby=@jcr:score, sort=desc} ] 21.10.2016 10:01:05.157 *DEBUG* [0:0:0:0:0:0:0:1 [1477058464602] GET /content/en-us/search-results.html HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl xpath query: //element(*, nt:hierarchyNode)[jcr:contains(., 'RC Series') and @jcr:primaryType = 'cq:Page']/rep:excerpt(.) order by @jcr:score descending 21.10.2016 10:01:05.159 *DEBUG* [0:0:0:0:0:0:0:1 [1477058464602] GET /content/en-us/search-results.html HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl xpath query creation took 3 ms 21.10.2016 10:01:05.672 *DEBUG* [0:0:0:0:0:0:0:1 [1477058464602] GET /content/en-us/search-results.html HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl >> xpath query returned 45 results (getSize) 21.10.2016 10:01:05.944 *DEBUG* [0:0:0:0:0:0:0:1 [1477058464602] GET /content/en-us/search-results.html HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl entire query execution took 788 ms

Please let me know if there is anything else that I need to provide.

0 Replies