Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

does this work?

  • Loading branch information...
commit fac359fc674d5134c8cf6deb6a27e4eef1873ab7 1 parent 98f34e1
@erwaller erwaller authored
Showing with 25 additions and 15 deletions.
  1. +25 −15 README.rdoc
View
40 README.rdoc
@@ -4,27 +4,37 @@ Soulmate is a tool to help solve the common problem of developing a fast autocom
Soulmate can offer suggestions for multiple types of items in a single query. An item is a simple JSON object that looks like:
-bc. {
- "id": 3,
- "term": "Citi Field",
- "score": 81,
- "data": {
- "url": "/citi-field-tickets/",
- "subtitle": "Flushing, NY"
+ {
+ "id": 3,
+ "term": "Citi Field",
+ "score": 81,
+ "data": {
+ "url": "/citi-field-tickets/",
+ "subtitle": "Flushing, NY"
+ }
}
-}
Where `id` is a unique identifier (within the specific type), `term` is the phrase you wish to provide completions for, `score` is a user-specified ranking metric (redis will order things lexigraphically for items with the same score), and `data` is an optional container for metadata you'd like to return when this item is matched (at SeatGeek we're including a url for the item as well as a subtitle for when we present it in an autocomplete dropdown).
-You can load data into Soulmate by piping items into `soulmate load`, like so:
+You can load data into Soulmate by piping items into `soulmate load`.
-Here's our `venues.json` (in the JSON lines format -- i.e. one JSON item per line):
+Here's a sample `venues.json` (in the JSON lines format -- i.e. one JSON item per line):
-bc. {"id":1,"term":"Dodger Stadium","score":85,"data":{"url":"\/dodger-stadium-tickets\/","subtitle":"Los Angeles, CA"}}
-{"id":28,"term":"Angel Stadium","score":85,"data":{"url":"\/angel-stadium-tickets\/","subtitle":"Anaheim, CA"}}
-{"id":30,"term":"Chase Field ","score":85,"data":{"url":"\/chase-field-tickets\/","subtitle":"Phoenix, AZ"}}
-{"id":29,"term":"Sun Life Stadium","score":84,"data":{"url":"\/sun-life-stadium-tickets\/","subtitle":"Miami, FL"}}
-{"id":2,"term":"Turner Field","score":83,"data":{"url":"\/turner-field-tickets\/","subtitle":"Atlanta, GA"}}
+ {"id":1,"term":"Dodger Stadium","score":85,"data":{"url":"\/dodger-stadium-tickets\/","subtitle":"Los Angeles, CA"}}
+ {"id":28,"term":"Angel Stadium","score":85,"data":{"url":"\/angel-stadium-tickets\/","subtitle":"Anaheim, CA"}}
+ {"id":30,"term":"Chase Field ","score":85,"data":{"url":"\/chase-field-tickets\/","subtitle":"Phoenix, AZ"}}
+ {"id":29,"term":"Sun Life Stadium","score":84,"data":{"url":"\/sun-life-stadium-tickets\/","subtitle":"Miami, FL"}}
+ {"id":2,"term":"Turner Field","score":83,"data":{"url":"\/turner-field-tickets\/","subtitle":"Atlanta, GA"}}
+
+And the load command (with redis running locally on the default port, or specify a redis connection string with the `--redis` argument):
+
+ $ soulmate load venue --redis=redis://localhost:6379/0 < venues.json
+
+Once it's loaded, we can query this data by starting `soulmate-web`:
+
+ $ soulmate-web --foreground --redis=redis://localhost:6379/0 --no-launch
+
+And viewing the service in your browser: <a href="http://localhost:5678/search?types[]=venue&term=stad">http://localhost:5678/search?types[]=venue&term=stad</a>.
== Contributing to soulmate
Please sign in to comment.
Something went wrong with that request. Please try again.