How to use Elvis API actors autocomplete


(Victor Nițu) #1

Extracted from the corresponding PR:

Improvements:

  • tokens are no longer kept in memory
  • better fuzzy matching
  • index only one actor name per x_slug_id
  • refactored indexing code so that we can update indices individually

To get suggestions:

GET api/v1/actor_autocomplete?text=plank&max_suggestions=25

Default max_suggestions = 10

Response:

 {
    "search": {
        "count": 1,
        "results": [
            {
                "name": "Peter Kattenbeck GmbH",
                "x_same_city": 0,
                "x_slug": "peter-kattenbeck-gmbh",
                "x_slug_id": 989848,
                "id": "58275167c91dcf4ed700018a",
                "type": "supplier"
            }
        ]
    }
}