Available Methods
- setQuery ( )
- setRows ( )
- set ( )
- add ( )
- setRequestHandler ( )
- addFilterQuery ( )
- setParam ( )
- setSort ( )
- setFacet ( )
- addSort ( )
- setFields ( )
- toString ( )
- setStart ( )
- addField ( )
- remove ( )
- setFacetSort ( )
- setHighlight ( )
- addFacetField ( )
- setFilterQueries ( )
- addTermsField ( )
- addFacetPivotField ( )
- setHighlightFragsize ( )
- setHighlightSimplePost ( )
Related Classes
- java.util.Arrays
- java.io.File
- java.util.Collections
- java.util.Date
- java.util.Iterator
- java.util.concurrent.TimeUnit
- java.util.stream.Collectors
- java.util.LinkedHashMap
- org.junit.Assert
- java.nio.charset.StandardCharsets
- java.util.concurrent.atomic.AtomicBoolean
- java.util.stream.Stream
- org.apache.commons.lang3.StringUtils
- java.util.LinkedHashSet
- java.util.EnumSet
- org.apache.commons.lang.StringUtils
- org.apache.solr.common.SolrInputDocument
- org.apache.solr.client.solrj.SolrServerException
- org.apache.solr.client.solrj.response.QueryResponse
- org.apache.solr.common.SolrDocument
- org.apache.solr.common.SolrDocumentList
- org.apache.solr.client.solrj.SolrClient
- org.apache.solr.common.util.NamedList
- org.apache.solr.client.solrj.impl.HttpSolrClient
- org.apache.solr.common.SolrException
Java Code Examples for org.apache.solr.client.solrj.SolrQuery#setHighlightFragsize()
The following examples show how to use
org.apache.solr.client.solrj.SolrQuery#setHighlightFragsize() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SolrFilterVisitor.java From Knowage-Server with GNU Affero General Public License v3.0 | 6 votes |
public void apply(SolrQuery solrQuery, Filter filter) { visit(filter); solrQuery.addFilterQuery(queryBuilder.toString()); List<LikeFilter> likeFilters = extractLikeFilters(filter); if (!likeFilters.isEmpty()) { solrQuery.addField("id"); solrQuery.setHighlight(true); solrQuery.setHighlightFragsize(0); solrQuery.add("hl.q", "*" + likeFilters.get(0).getValue() + "*"); for (LikeFilter likeFilter : likeFilters) { String fieldName = likeFilter.getProjection().getName(); if(highlightFields.contains(fieldName)) { solrQuery.addHighlightField(fieldName); } } } }