/** * Controls if the excerpt from a field is generated only for searched fields, or for all fields (the default).<p> * * The default setting is <code>false</code>, which means all text fields configured for the excerpt will * be used to generate the excerpt, regardless if they have been searched in or not.<p> * * Please note: A field will only be included in the excerpt if it has been configured as <code>excerpt="true"</code> * in <code>opencms-search.xml</code>. This method controls if so configured fields are used depending on the * fields searched, see {@link #setField(String[])}.<p> * * @param value if <code>true</code>, the excerpt is generated only from the fields actually searched in */ public void setExcerptOnlySearchedFields(boolean value) { m_parameters.setExcerptOnlySearchedFields(value); resetLastResult(); }
/** * Controls if the excerpt from a field is generated only for searched fields, or for all fields (the default).<p> * * The default setting is <code>false</code>, which means all text fields configured for the excerpt will * be used to gernerate the excerpt, regardless if they have been searched in or not.<p> * * Please note: A field will only be included in the excerpt if it has been configured as <code>excerpt="true"</code> * in <code>opencms-search.xml</code>. This method controls if so configured fields are used depending on the * fields searched, see {@link #setField(String[])}.<p> * * @param value if <code>true</code>, the excerpt is generated only from the fields actually searched in */ public void setExcerptOnlySearchedFields(boolean value) { m_parameters.setExcerptOnlySearchedFields(value); resetLastResult(); }
/** * Wraps this parameters to the standard search parameters, so that inherited methods in the search index * can be used.<p> * * @return this parameters wrapped to the standard search parameters */ protected CmsSearchParameters getCmsSearchParams() { CmsSearchParameters result = new CmsSearchParameters(); result.setFields(getFields()); result.setExcerptOnlySearchedFields(true); if (getSearchWords() != null) { result.setQuery(getSearchWords()); result.setIgnoreQuery(false); } else { result.setIgnoreQuery(true); } return result; }