mysql - How to keep normalized models when searching via ElasticSearch? -


when setting mysql / elasticsearch combo, better to:

  1. completely sync model information es (even non-search data), when result found, have information handy.

  2. only sync searchable fields, , when results back, use id field find actual data in mysql database?

elasticsearch search engine. advise not use database system. suggest index search data , unique id database can retrieve results mysql using unique key returned elasticsearch. way you'll using both applications they're intended. elastic search not best querying relations , you'll have write lot more code operating on related data using mysql it.

also, don't want tie persistence layer search layer. these should independent possible, , change in 1 should not affect other, as possible. otherwise, you'll have update both systems if either has change. querying mysql on ids fast, can use , leave slow part (querying on full text) elastic search.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -