Creating query interceptors
All the routes of the Lookup service are of type :get as they are used only to query the data. Since the data resides with Elasticsearch, the requests needs to be mapped to relevant Elasticsearch queries to get the required result. Interceptors to query Elasticsearch data read the required fields from the :tx-data field of the Pedestal context as set by the validation interceptors. The implementation of the validator that wraps the queries to Elasticsearch is the same as that of other services explained earlier.
Elasticsearch defines a Query DSL (https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html) that must be used to query the data against the Elasticsearch index. The Query DSL is based ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access