简体   繁体   English

刷新索引之前的“ Elasticsearch”搜索文档

[英]“Elasticsearch” search documents before index refresh

I am writing a php application that stores data in Elasticsearch . 我正在编写一个将数据存储在Elasticsearch中php应用程序。 I want to be able to search for latest indexed data from elasticsearch in realtime ( Without the index refresh time barrier ). 我希望能够从Elasticsearch实时搜索最新的索引数据(没有索引刷新时间障碍)。 How do i achieve such functionality? 我如何实现这种功能?

Note : The following never helped achieve real timeness 注意:以下内容从不帮助实现实时性

$client->indices()->refresh();

Nor 也不

'refresh'   => true

-- Elasticsearch V2.3 -Elasticsearch V2.3

-- I am Using the official PHP Elasticsearch Driver - 我正在使用官方的PHP Elasticsearch驱动程序

You can set the refresh interval for any index using the following query. 您可以使用以下查询来设置任何索引的刷新间隔。 . .But usually while indexing documents in bulk this value will be changed to -1, which means never refresh , i will refresh manually. 但是,通常在成批索引文档时,此值将更改为-1,这表示从不刷新,我将手动刷新。 Because low refresh rate may result in performance hits on indexing rate. 因为低刷新率可能会导致索引率性能下降。 go through following link for more details https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html#bulk 请通过以下链接了解更多详细信息https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html#bulk

` `

curl -XPUT localhost:9200/test/_settings -d '{
    "index" : {
        "refresh_interval" : "1s"
    } }'

` `

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM