可以在seafevents.conf中设置以下选项来控制文件搜索的行为。你需要重新启动seafile和seahub使它们生效。
[INDEX FILES]
## must be "true" to enable search
enabled = true
## The interval the search index is updated. Can be s(seconds), m(minutes), h(hours), d(days)
interval=10m
## If true, indexes the contents of office/pdf files while updating search index
## Note: If you change this option from "false" to "true", then you need to clear the search index and update the index again.
index_office_pdf=false
全文搜索默认情况下不启用以保存系统资源。如果要启用它,您需要按照以下说明进行操作。
首先,您必须在 seafevents.conf
中将 index_office_pdf
选项的值设置为 true
。
然后重新启动seafile服务。
cd /data/haiwen/seafile-pro-server-1.7.0/
./seafile.sh restart
你需要删除现有的搜索索引并重建它。
./pro/pro.py search --clear
./pro/pro.py search --update
搜索模块使用与Seafile Professional Server捆绑在一起的ElasticSearch服务。但是,您可能在您的公司中运行了一个现有的ElasticSearch服务器或集群。在这种情况下,您可以更改配置文件以使用现有的ES服务器或集群。
此功能在Seafile Professional Server 2.0.5中已添加。
seafevents.conf
,添加 [index files] 配置段中的配置来指定您的 ES 服务器地址和端口[INDEX FILES]
...
external_es_server = true
es_host = 192.168.1.101
es_port = 9500
external_es_server
:设置为 true
告知 seafile 将不再启动它自己的 elasticsearch 服务。es_host
:是您的 ES 服务器的IP地址。es_port
:Thrift transport 模块监听的地址,默认应该是 9500
。您可以通过执行以下命令重建搜索索引:
./pro/pro.py search --clear
./pro/pro.py search --update
如果这样不能解决问题,可以尝试以下步骤:
rm -rf pro-data/search
./pro/pro.py search --update
搜索索引默认每10分钟更新一次,所以在执行第一次搜索更新之前,无论你搜索什么都没有结果。
为了能立即搜索:
cd haiwen/seafile-pro-server-2.0.4
./pro/pro.py search --update
这是因为服务器无法对加密文件进行索引,因为它们被加密了。
搜索功能基于Elasticsearch服务,这是一个Java进程。要增加Java堆内存大小,可以通过修改jvm配置文件来修改Elasticsearch使用的内存大小空间。例如,修改为2G内存空间。修改seafile-server-latest/pro/elasticsearch/config/jvm.options
文件的以下配置项:
-Xms2g # 最小使用内存空间
-Xmx2g # 最大使用内存空间
### 建议将以上两个配置项的值设置为一样大小。
重启seafile服务使上述修改生效:
./seafile.sh restart
./seahub.sh restart
Last modified by Daniel Pan, 2021-08-17