An Elasticsearch query goes through the following steps:
- The user sends a query from the client application to the Application Service.
- The Application Service combines query content with the user’s security profile.
- The Application Service sends the query to Elasticsearch.
- The Application Service receives a list of folio numbers from the Elasticsearch search result, and uses these numbers to retrieve the full set of folio data from the SQL database.
Because the Elasticsearch index might not be consistent with the database, it’s possible the search result from Elasticsearch includes folios that no longer exist in the database. If this is the case, the Application Service might request more results from Elasticsearch to ensure the “max records” specified by the user is fulfilled.
- The search result is returned to the client application.