本文整理汇总了Java中org.apache.solr.common.params.SolrParams.getFieldBool方法的典型用法代码示例。如果您正苦于以下问题:Java SolrParams.getFieldBool方法的具体用法?Java SolrParams.getFieldBool怎么用?Java SolrParams.getFieldBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.solr.common.params.SolrParams
的用法示例。
在下文中一共展示了SolrParams.getFieldBool方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newBytesRefFilter
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
protected Predicate<BytesRef> newBytesRefFilter(String field, SolrParams params) {
final String contains = params.getFieldParam(field, FacetParams.FACET_CONTAINS);
final Predicate<BytesRef> containsFilter;
if (contains != null) {
final boolean containsIgnoreCase = params.getFieldBool(field, FacetParams.FACET_CONTAINS_IGNORE_CASE, false);
containsFilter = new SubstringBytesRefFilter(contains, containsIgnoreCase);
} else {
containsFilter = null;
}
final Predicate<BytesRef> excludeFilter = newExcludeBytesRefFilter(field, params);
if (containsFilter == null && excludeFilter == null) {
return null;
}
if (containsFilter != null && excludeFilter == null) {
return containsFilter;
} else if (containsFilter == null && excludeFilter != null) {
return excludeFilter;
}
return containsFilter.and(excludeFilter);
}
示例2: fillParams
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
protected void fillParams(ResponseBuilder rb, SolrParams params, String field) {
this.field = field;
this.ftype = rb.req.getSchema().getFieldTypeNoEx(this.field);
this.offset = params.getFieldInt(field, FacetParams.FACET_OFFSET, 0);
this.limit = params.getFieldInt(field, FacetParams.FACET_LIMIT, 100);
Integer mincount = params.getFieldInt(field, FacetParams.FACET_MINCOUNT);
if (mincount == null) {
Boolean zeros = params.getFieldBool(field, FacetParams.FACET_ZEROS);
// mincount = (zeros!=null && zeros) ? 0 : 1;
mincount = (zeros != null && !zeros) ? 1 : 0;
// current default is to include zeros.
}
this.minCount = mincount;
this.missing = params.getFieldBool(field, FacetParams.FACET_MISSING, false);
// default to sorting by count if there is a limit.
this.sort = params.getFieldParam(field, FacetParams.FACET_SORT,
(limit > 0 ?
FacetParams.FACET_SORT_COUNT
: FacetParams.FACET_SORT_INDEX));
if (this.sort.equals(FacetParams.FACET_SORT_COUNT_LEGACY)) {
this.sort = FacetParams.FACET_SORT_COUNT;
} else if (this.sort.equals(FacetParams.FACET_SORT_INDEX_LEGACY)) {
this.sort = FacetParams.FACET_SORT_INDEX;
}
this.prefix = params.getFieldParam(field, FacetParams.FACET_PREFIX);
}
示例3: parse
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
void parse(SolrParams params, ResponseBuilder rb) {
queryFacets = new LinkedHashMap<>();
facets = new LinkedHashMap<>();
String[] facetQs = params.getParams(FacetParams.FACET_QUERY);
if (facetQs != null) {
for (String query : facetQs) {
QueryFacet queryFacet = new QueryFacet(rb, query);
queryFacets.put(queryFacet.getKey(), queryFacet);
}
}
String[] facetFs = params.getParams(FacetParams.FACET_FIELD);
if (facetFs != null) {
for (String field : facetFs) {
final DistribFieldFacet ff;
if (params.getFieldBool(field, FacetParams.FACET_EXISTS, false)) {
// cap facet count by 1 with this method
ff = new DistribFacetExistsField(rb, field);
} else {
ff = new DistribFieldFacet(rb, field);
}
facets.put(ff.getKey(), ff);
}
}
// Develop Pivot Facet Information
String[] facetPFs = params.getParams(FacetParams.FACET_PIVOT);
if (facetPFs != null) {
for (String fieldGroup : facetPFs) {
PivotFacet pf = new PivotFacet(rb, fieldGroup);
pivotFacets.add(pf.getKey(), pf);
}
}
heatmapFacets = SpatialHeatmapFacets.distribParse(params, rb);
}
示例4: fillParams
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
protected void fillParams(ResponseBuilder rb, SolrParams params, String field) {
super.fillParams(rb, params, field);
this.overrequestRatio
= params.getFieldDouble(field, FacetParams.FACET_OVERREQUEST_RATIO, 1.5);
this.overrequestCount
= params.getFieldInt(field, FacetParams.FACET_OVERREQUEST_COUNT, 10);
this.mco
= params.getFieldBool(field, FacetParams.FACET_DISTRIB_MCO, false);
}
示例5: parse
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
void parse(SolrParams params, ResponseBuilder rb) {
statsFields = new HashMap<>();
String[] statsFs = params.getParams(StatsParams.STATS_FIELD);
if (statsFs != null) {
for (String field : statsFs) {
boolean calcDistinct = params.getFieldBool(field, StatsParams.STATS_CALC_DISTINCT, false);
SchemaField sf = rb.req.getSchema().getField(field);
statsFields.put(field, StatsValuesFactory.createStatsValues(sf, calcDistinct));
}
}
}
示例6: useFastVectorHighlighter
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
private boolean useFastVectorHighlighter( SolrParams params, IndexSchema schema, String fieldName ){
SchemaField schemaField = schema.getFieldOrNull( fieldName );
if( schemaField == null ) return false;
boolean useFvhParam = params.getFieldBool( fieldName, HighlightParams.USE_FVH, false );
if( !useFvhParam ) return false;
boolean termPosOff = schemaField.storeTermPositions() && schemaField.storeTermOffsets();
if( !termPosOff ) {
log.warn( "Solr will use Highlighter instead of FastVectorHighlighter because {} field does not store TermPositions and TermOffsets.", fieldName );
}
return termPosOff;
}
示例7: isMergeContiguousFragments
import org.apache.solr.common.params.SolrParams; //导入方法依赖的package包/类
/**
* Return whether adjacent fragments should be merged.
* @param fieldName The name of the field
* @param params The params controlling Highlighting
*/
protected boolean isMergeContiguousFragments(String fieldName, SolrParams params){
return params.getFieldBool(fieldName, HighlightParams.MERGE_CONTIGUOUS_FRAGMENTS, false);
}