/** * @see org.opencms.jsp.search.controller.I_CmsSearchController#addQueryParts(CmsSolrQuery) */ @Override public void addQueryParts(CmsSolrQuery query) { final Iterator<I_CmsSearchController> it = m_controllers.iterator(); it.next().addQueryParts(query); while (it.hasNext()) { it.next().addQueryParts(query); } // fix for highlighting bug if ((getHighlighting() != null) && !((query.getParams("df") != null) || (query.getParams("type") != null))) { String df = getHighlighting().getConfig().getHightlightField().trim(); int index = df.indexOf(' '); query.add("df", (index > 0 ? df.substring(0, index) : df)); } }
/** * Ensures that at least the 'path' and the 'type' are part of the fields returned field list.<p> * * @see CommonParams#FL */ private void ensureReturnFields() { String[] fl = getParams(CommonParams.FL); if ((fl != null) && (fl.length > 0)) { List<String> result = new ArrayList<String>(); for (String field : fl) { String commasep = field.replaceAll(" ", ","); List<String> list = CmsStringUtil.splitAsList(commasep, ','); if (!list.contains("*")) { for (String reqField : CmsStringUtil.splitAsList(MINIMUM_FIELDS, ",")) { if (!list.contains(reqField)) { list.add(reqField); } } } result.addAll(list); } setParam(CommonParams.FL, CmsStringUtil.arrayAsString(result.toArray(new String[0]), ",")); } }