I need to define a context for a Completion field. Is it possible to do it using elasticsearch-dsl? Because I need to limit context of completion suggester using another field (user_id) defined in my mapping.
Sure, just pass in the contextx:
auto_complete = Completion(contexts=[{"name": "color", "type": "category", "path": "color"}])
Hope this helps
Hi, I tried the exact example (except assign the results to a variable called suggest versus to_complete) above using elasticsearch-dsl version 2.2.0 with Elastic Search version 2.3.4 and received an error below. Any thoughts on why this may be happening?
Thanks,
Mike
TransportError(400, 'mapper_parsing_exception', 'Mapping definition for [suggest] has unsupported parameters: [contexts : [{path=color, name=color, type=category}]]'
Most helpful comment
Sure, just pass in the contextx:
Hope this helps