class Blacklight::Solr::Response::Facets::FacetField
represents a facet; which is a field and its values
Attributes
items[R]
missing[RW]
name[R]
Public Class Methods
new(name, items, options = {})
click to toggle source
# File lib/blacklight/solr/response/facets.rb, line 35 def initialize name, items, options = {} @name = name @items = items @options = options end
Public Instance Methods
count?()
click to toggle source
# File lib/blacklight/solr/response/facets.rb, line 73 def count? sort == 'count' end
data()
click to toggle source
# File lib/blacklight/solr/response/facets.rb, line 61 def data @options[:data] || {} end
index?()
click to toggle source
# File lib/blacklight/solr/response/facets.rb, line 69 def index? sort == 'index' end
limit()
click to toggle source
# File lib/blacklight/solr/response/facets.rb, line 41 def limit @options[:limit] || solr_default_limit end
offset()
click to toggle source
# File lib/blacklight/solr/response/facets.rb, line 49 def offset @options[:offset] || solr_default_offset end
prefix()
click to toggle source
# File lib/blacklight/solr/response/facets.rb, line 53 def prefix @options[:prefix] || solr_default_prefix end
response()
click to toggle source
# File lib/blacklight/solr/response/facets.rb, line 65 def response @options[:response] end
sort()
click to toggle source
# File lib/blacklight/solr/response/facets.rb, line 45 def sort @options[:sort] || solr_default_sort end
type()
click to toggle source
# File lib/blacklight/solr/response/facets.rb, line 57 def type @options[:type] || 'terms' end
Private Instance Methods
solr_default_limit()
click to toggle source
Per wiki.apache.org/solr/SimpleFacetParameters#facet.limit
# File lib/blacklight/solr/response/facets.rb, line 80 def solr_default_limit 100 end
solr_default_offset()
click to toggle source
Per wiki.apache.org/solr/SimpleFacetParameters#facet.offset
# File lib/blacklight/solr/response/facets.rb, line 94 def solr_default_offset 0 end
solr_default_prefix()
click to toggle source
# File lib/blacklight/solr/response/facets.rb, line 98 def solr_default_prefix nil end
solr_default_sort()
click to toggle source
Per wiki.apache.org/solr/SimpleFacetParameters#facet.sort
# File lib/blacklight/solr/response/facets.rb, line 85 def solr_default_sort if limit > 0 'count' else 'index' end end