Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the solr4.7 highlighting method

Shulou Source: shulou.com Published: 2022-06-01 09:15:41 10月05日 Update

This article mainly explains the "solr4.7 highlighting method is what", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "solr4.7 highlighting method is what" it!

The first is the solrj operation:

Public SolrDocumentList query (String str) {SolrQuery query = new SolrQuery (str); query.setHighlight (true); / / enable highlight query.addHighlightField ("name,content"); / / highlight fields: multiple fields can be separated by spaces or commas query.setHighlightSimplePre (""); / / render label query.setHighlightSimplePost (""); / / render tag query.setParam ("f.content.hl.fragsize", "200") QueryResponse qr=server.query (query); / / execute the query SolrDocumentList dlist=qr.getResults (); System.out.println ("Total:" + dlist.getNumFound ()); / / the key of the first Map is the ID of the document, and the key of the second Map is the highlighted field name Map map = qr.getHighlighting (); for (int item0)

Tags: Highlight field method configuration content parameter summary query maximum label this is wildcard function multiple character that is regular result expression comma Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei NVidia MariaDB Shulou Information OPPO Reno