Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refresh param to bulk not working #614

Closed
clintongormley opened this issue Jan 8, 2011 · 2 comments
Closed

refresh param to bulk not working #614

clintongormley opened this issue Jan 8, 2011 · 2 comments

Comments

@clintongormley
Copy link

Passing refresh=true to the bulk command does not seem to have any effect.

# [Sat Jan  8 20:01:30 2011] Protocol: http, Server: 127.0.0.1:9200
curl -XPUT 'http://127.0.0.1:9200/foo/'  -d '
{}
'

# [Sat Jan  8 20:01:30 2011] Response:
# {
#    "ok" : true,
#    "acknowledged" : true
# }

# [Sat Jan  8 20:01:34 2011] Protocol: http, Server: 127.0.0.1:9200
curl -XPOST 'http://127.0.0.1:9200/_bulk?refresh=true'  -d '
{"index" : {"_index" : "foo", "_id" : 1, "_type" : "bar"}}
{"text" : "foo"}
{"index" : {"_index" : "foo", "_id" : 2, "_type" : "bar"}}
{"text" : "bar"}
'

# [Sat Jan  8 20:01:34 2011] Response:
# {"items" : [{"index" : {"ok" : true, "_index" : "foo", "_id" : "1
# > ", "_type" : "bar"}}, {"index" : {"ok" : true, "_index" : "foo"
# > , "_id" : "2", "_type" : "bar"}}]}

# [Sat Jan  8 20:01:34 2011] Protocol: http, Server: 127.0.0.1:9200
curl -XGET 'http://127.0.0.1:9200/foo/_count'  -d '
{"match_all" : {}}'

# [Sat Jan  8 20:01:34 2011] Response:
# {"count" : 0, "_shards" : {"failed" : 0, "successful" : 5, "total
# > " : 5}}

I also tried setting index.refresh_interval: -1 and passing refresh=true as above, and the index doesn't refresh at all, until I pass it an actual /_refresh

@kimchy
Copy link
Member

kimchy commented Jan 9, 2011

refresh param to bulk not working, closed by d650705.

@clintongormley
Copy link
Author

OK - refreshes are now being triggered, but the refresh is still async, which makes for clumsy client code.

In other words, I do the bulk index, having passed refresh=true and then I expect to be able to continue directly on to the next statement in my code, which expects the index to have been refreshed.

However, what is happening is that the refresh is queued, and by the time I send my next request, it still hasn't completed. This means that I'm having to wait an unspecified amount of time (because I don't know how long the refresh will take) before I can continue running my code.

Should refresh=true not block?

tallpsmith pushed a commit to tallpsmith/elasticsearch that referenced this issue May 5, 2011
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
williamrandolph pushed a commit to williamrandolph/elasticsearch that referenced this issue Jun 4, 2020
jev001 pushed a commit to jev001/elasticsearch that referenced this issue Dec 28, 2022
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this issue Oct 2, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants