Skip to content

Commit

Permalink
Document rank option
Browse files Browse the repository at this point in the history
  • Loading branch information
cvincent committed Apr 2, 2013
1 parent d26b43f commit 1985a85
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ for easy integration with your Rails apps.
asari = Asari.new("my-search-domain-asdfkljwe4") # CloudSearch search domain
asari.add_item("1", { :name => "Tommy Morgan", :email => "[email protected]"})
asari.search("tommy") #=> ["1"] - a list of document IDs
asari.search("tommy", :rank => "name") # Sort the search
asari.search("tommy", :rank => ["name", :desc]) # Sort the search descending
asari.search("tommy", :rank => "-name") # Another way to sort the search descending

#### Sandbox Mode

Expand Down Expand Up @@ -71,6 +74,7 @@ with your AR objects as follows:
# Klass.asari_find returns a list of model objects in an
# Asari::Collection...
User.asari_find("tommy") #=> [<User:...>, <User:...>, <User:...>]
User.asari_find("tommy", rank => "name")

# or with a specific instance, if you need to manually do some index
# management...
Expand Down

0 comments on commit 1985a85

Please sign in to comment.