forked from itstommymorgan/asari
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
4 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|
@@ -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... | ||
|