有没有办法在不重新启动 Solr 服务器的情况下动态更新同义词文件? [英] Is there a way to dynamically update a synonym file without restarting Solr server?

查看:55
本文介绍了有没有办法在不重新启动 Solr 服务器的情况下动态更新同义词文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

众所周知,conf目录中有一个synonym.txt文件,每当我发现一些新的同义​​词时,我都想更新它...

As we know there is a synonym.txt file in conf directory, which I wanted to update whenever I found some new synonym words...

那么有没有办法在不重启Solr 服务器的情况下动态更新该文件,我的搜索结果会考虑新的同义词吗??

So is there any way to update that file dynamically without restarting the Solr server and will my search result consider the new synonym words??

如果有人有任何想法,请帮助我..提前致谢...

please help me if anyone have any idea.. thanks in advance...

推荐答案

我认为你可以建立自己的 SynonymFilterFactory 扩展原始并使用您的自定义 FSTSynonymFilterFactory 作为委托人.您的 SynonymFilterFactory 应该扩展原始的 SlowSynonymFilterFactory 并调用:

I think you can build your own SynonymFilterFactory that extends the original and use your a custom FSTSynonymFilterFactory as delegator. your SynonymFilterFactory should extends the original SlowSynonymFilterFactory and call:

map = loadSolrSynonyms(loader, true, analyzer);

每当您想重新加载同义词文件时.

whenever you want to reload the synonym file.

要在文件更改时重新加载文件,您可以使用每 X 次唤醒的看门狗线程并检查 sysnonim 文件是否已更改,或者您可以使用一些 file watcher 以在文件更改时获得通知.

For reloading your file when it changes you can use a watchdog thread that awke up every X time and check whether the sysnonim file was changed or you can use some file watcher to get notification when the file was changed.

这篇关于有没有办法在不重新启动 Solr 服务器的情况下动态更新同义词文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆