Add helper method to retrieve and sort facets

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@499438 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erik Hatcher 2007-01-24 15:23:11 +00:00
parent f294acbcd7
commit 1bebd85d26
1 changed files with 5 additions and 0 deletions

View File

@ -36,6 +36,11 @@ module Solr
def max_score
return @response['maxScore']
end
def field_facets(field)
@data['facet_counts']['facet_fields'][field].sort {|a,b| b[1] <=> a[1]}
end
# supports enumeration of hits
def each