List of usage examples for org.apache.solr.handler.component ResponseBuilder setHighlightQuery
public void setHighlightQuery(Query highlightQuery)
From source file:com.memonews.solr.handler.component.HighlightQueryComponent.java
License:Apache License
@Override public void process(final ResponseBuilder rb) throws IOException { if (rb.doHighlights) { final SolrQueryRequest req = rb.req; final SolrParams params = req.getParams(); final String qstr = params.get(CommonParams.Q); if (LOG.isDebugEnabled()) { LOG.info("Original query: " + qstr); }// ww w . j a va 2s . c o m try { Query parsedQuery = parseAndCleanQuery(qstr, req, NAME); if (parsedQuery != null) { rb.setHighlightQuery(parsedQuery); } } catch (ParseException e1) { throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e1); } } }