Marklogic - highlighting cts:element-attribute-range-query output

心已入冬 提交于 2019-12-11 08:42:50

问题


i am doing a cts:element-attribute-range-query and the results from it is working fine. But highlighting is not working for the output result. When i referred the search guide

http://developer.marklogic.com/pubs/4.2/books/search-dev-guide.pdf

i could see that cts:element-attribute-*-query outputs will not be suitable for cts:highlight function. I am using Marklogic 4.2. My application greatly depends on this highlighted output, Is there any way i can highlight the result output of cts:element-attribute-range query?


回答1:


You could try cts:walk instead of cts:highlight. During the walk, look for nodes where cts:contains returns true for the attribute portion of your query. Then you can highlight those nodes using whatever mechanism you like.

http://developer.marklogic.com/pubs/4.2/apidocs/SearchBuiltins.html#cts:walk has examples.



来源:https://stackoverflow.com/questions/9259253/marklogic-highlighting-ctselement-attribute-range-query-output

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!