elasticsearch.js

Sync elasticsearch on connection with database - nodeJS

故事扮演 提交于 2020-02-25 21:25:06
问题 Aim : sync elasticsearch with postgres database Why : sometimes newtwork or cluster/server break so future updates should be recorded This article https://qafoo.com/blog/086_how_to_synchronize_a_database_with_elastic_search.html suggests that I should create a separate table updates that will sync elasticsearch's id , allowing to select new data (from database) since the last record (in elasticsearch). So I thought what if I could record elasticsearch's failure and successful connection: if

Map a book in elasticsearch with many levels, nested vs parent-child relationship

两盒软妹~` 提交于 2019-12-02 08:31:01
When creating the mappings for an index that can search through multiple books, is it preferable to use nested mappings like below, or using documents with a parent-child relationship book: { properties: { isbn: { //- ISBN of the book type: 'string' //- 9783791535661 }, title: { //- Title of the book type: 'string' //- Alice in Wonderland }, author: { //- Author of the book(maybe should be array) type: 'string' //- Lewis Carroll }, category: { //- Category of the book(maybe should be array) type: 'string' //- Fantasy }, toc: { //- Array of the chapters in the book type: 'nested', properties: {