Soulmate: Develop a fast autocomplete feature
Redis-backed service for fast autocompleting - extracted from SeatGeek
Soulmate is a tool to help solve the common problem of developing a fast autocomplete feature. It uses Redis's sorted sets to build an index of partially completed words and the corresponding top matching items, and provides a simple sinatra app to query them. Soulmate finishes your sentences.
Soulmate was designed to be simple and fast, and offers the following:
- Provide suggestions for multiple types of items in a single query (at SeatGeek we're autocompleting for performers, events, and venues)
- Results are ordered by a user-specified score
- Arbitrary metadata for each item (at SeatGeek we're storing both a url and a subtitle)
An item is a simple JSON object that looks like:
{
"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 lexicographically 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).
See Soulmate in action at SeatGeek.
'프로그래밍 > App' 카테고리의 다른 글
[Window] 네트워크 드라이브 연결 포트 (0) | 2014.01.17 |
---|---|
Makeappicon: Generate properly sized icons quickly and easily (0) | 2013.12.30 |
UUhistle.org: A program visualization tool (0) | 2013.12.05 |
[scaloid] Improve API documentation (#69) (0) | 2013.11.06 |
[APP] smart TV, 스마트 TV 환경 (0) | 2013.11.05 |