[opencms-dev] CmsSolrResultList and highlighting

Marc Johnen opencms at johnen.biz
Wed Jul 10 20:12:45 CEST 2013


Hello everyone,

I'm using the following to search my site:

String query =
"hl=true&hl.q=true&hl.fl=*&hl.simple.pre*=&hl.simple.post=*&hl.snippets=50&fq=text:abc&fq=type:toolbox-detail&fq=parent-folders:(/sites/default/tools_and_services/toolbox/)&rows=10";

CmsJspContentAccessBean   cms = (CmsJspContentAccessBean )
pageContext.getAttribute("content");
CmsSolrResultList results = OpenCms.getSearchManager().getIndexSolr("Solr
Offline").search(cms.getCmsObject(), query);

for(int i=0;i<results.size();i++){
	out.print(results.get(i).getField("en_excerpt")+"<br/>"
);
}

I do get korrekt results but the excerpt does not have any highlighting as I
would have expected
and as the results using "CmsSearch" do. Is this not supported or am I
making a mistake.

Happy about any hints.



-----
Greetings
Marc Johnen
http://www.johnen.biz
--
View this message in context: http://opencms.996256.n3.nabble.com/CmsSolrResultList-and-highlighting-tp23441.html
Sent from the OpenCMS mailing list archive at Nabble.com.



More information about the opencms-dev mailing list