How to Elasticsearch entities not created using API (jhipster)

不打扰是莪最后的温柔 提交于 2019-12-08 11:24:39

问题


Using Jhipster with Postgresql, I have created an entity "Customer". When I add data to this entity using the Angular UI or POST to the API, I can search this data using the search form on the UI.

However, when I insert data in the database directly, the data is not searchable even after application restart. The search would still work (only) on the data added through the UI.

I am new to elasticsearch and do not know if there is a missing step between inserting data on the backend and making it available to elasticsearch. Please help, if there is something I need to configure to let elasticsearch pick up data from the database during application startup.

My application-dev.yml excerpt for spring data elasticsearch:

    data:
    elasticsearch:
        cluster-name:
        cluster-nodes:
        properties:
            path:
              logs: target/elasticsearch/log
              data: target/elasticsearch/data

回答1:


Elasticsearch is essentially a datastore which is why JHipster saves to the search repositories at the same time as the regular JPA repositories. There is no built-in reindexing functionality for making changes to it outside of the API.

I have written a module that will generate a service for reindexing all entities.

https://github.com/geraldhumphries/generator-jhipster-elasticsearch-reindexer



来源:https://stackoverflow.com/questions/34562441/how-to-elasticsearch-entities-not-created-using-api-jhipster

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!