Julius Moshiro
Julius Moshiro

Reputation: 730

"Elasticsearch" search documents before index refresh

I am writing a php application that stores data in Elasticsearch. I want to be able to search for latest indexed data from elasticsearch in realtime ( Without the index refresh time barrier ). How do i achieve such functionality?

Note : The following never helped achieve real timeness

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

Nor

'refresh'   => true

-- Elasticsearch V2.3

-- I am Using the official PHP Elasticsearch Driver

Upvotes: 0

Views: 892

Answers (1)

Ravikiran kalal
Ravikiran kalal

Reputation: 1070

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. 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

`

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

`

Upvotes: 1

Related Questions