我知道有几个类似的问题,但他们不能提供一个简单的答案的问题。对不起,如果你觉得这是一个重复,但我认为清楚和可理解的答案将有益于许多。所以,问题。
Solr索引更新可以自动化吗?如果可以,最好的方法是什么?
这里是一个简单的用例来澄清问题:我有一个数据库表,不同种类的数据。有一个Web应用程序用于管理数据。我有单独的Solr服务器来索引上面提到的表中的指定列。我如何实现一个结果,当用户添加,删除或修改所述表中的数据时,Solr会注意到更改和修改索引。
这是必要的,它是实时。这意味着在几秒钟后将发生更改。
解决方案 div>这里有两个问题:
Solr索引更新可以自动进行吗?
是的,他们可以,他们应该总是自动的。您不想为每次更改手动启动索引过程。
这是必须的实时。
我已经提到了一些方法来减少更改数据和更新索引之间的延迟在此答案中。您可以使用 autoCommit 确保您的数据在更新的x秒内提交。根据时间间隔,您可能希望减少自动升温并调整其他设置,请参见此
另请注意 NRT wiki页面获取相关信息和解决方案。
I know there are several questions similar to this but they don't provide a simple answer to the problem at hand. Sorry if you feel this is a duplicate but I think clear and understandable answer would benefit many. So, to the question.
Can Solr indexing updates be automated? And if they can, what would be the optimal way to do it?
Here is a simple use case to clarify the question: I have a database table with several columns of different kind of data. There is a web app which is used to manage the data. I've got separate Solr server to index specified columns in the above mentioned table. How could I achieve an outcome that when users adds, removes or modifies data in the said table, Solr would notice the changed and modify the index.
It would be necessary for it to be "real time". Meaning that after few seconds the changes would take place. Of course with large amount of data it can be more.
Thanks in advance
解决方案There are two questions here:
Can Solr indexing updates be automated?
Yes they can, and they should be always automated. You don't want to manually launch the indexing process for every change.
It would be necessary for it to be "real time".
I already mentioned some ways to reduce latency between changed data and updating the index in this answer. You could use autoCommit to make sure that your data is committed within x seconds of the update. Depending on the interval, you'd want to reduce autowarming and adjust other settings, see this for more details.
Also keep an eye on the NRT wiki page for related information and solutions about this.
更多推荐
Solr“实时”索引
发布评论