Method: Xapit::Server::Query#facet_option

Defined in:
lib/xapit/server/query.rb

#facet_option(identifier) ⇒ Object



69
70
71
72
73
74
75
76
77
# File 'lib/xapit/server/query.rb', line 69

def facet_option(identifier)
  match = self.class.new([{:in_classes => ["FacetOption"]}, {:where => {:id => identifier}}]).matches.first
  if match.nil?
    raise "Unable to find facet option for #{identifier}."
  else
    name, value = match.document.data.split('|||')
    {:id => identifier, :name => name, :value => value}
  end
end