Skip to content
This repository has been archived by the owner on Apr 27, 2020. It is now read-only.

Initialize ES mapping when the API starts for the first time #47

Open
malave opened this issue Aug 22, 2017 · 1 comment
Open

Initialize ES mapping when the API starts for the first time #47

malave opened this issue Aug 22, 2017 · 1 comment

Comments

@malave
Copy link
Collaborator

malave commented Aug 22, 2017

Issue: Currently the the ES index and documents (for flow and flowTemplate) are been created dynamically once we create the first documents.
The flowTemplate causes errors when the channel-sources container runs since we have documents with different structures, in this case the parameter attributes in the flowTemplate could have a different structure if this is a list.

Solution 1: as the tittle says, initialize the mapping when the API is first run.

Solution 2: Store data in a different and simpler way (some memory DB that dump to disk regularly that we can embed or something else) . The API (the hapijs section) doesn't really need to access ES since it's only function is to save and retrieve flow and flowTemplate, and small additional advantage would be not waiting for ES to finish indexing some data that we just modified before we can query it again.

@malave malave changed the title Map ES mapping when service is started Initialize ES mapping when the API starts for the first time Jun 7, 2018
@malave
Copy link
Collaborator Author

malave commented Jun 11, 2018

Also we need enable fielddata attribute during mapping in order to make text fields sortable. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant