PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, October 24, 2022

[FIXED] Why is ElasticSearch index searchable when refresh_interval is set to -1 on initial data upload?

 October 24, 2022     elasticsearch, indexing, refresh     No comments   

Issue

I'm performing a large upload of data to an empty index.

This article suggests to set "refresh_interval=-1" and "number_of_replicas=0" to increase upload performance. Then it says to enable it back.

The interesting thing is that if I don't enable it back - I can still send the queries to the newly created index and get the results.

I'd like to know why is that and what I got wrong ? (My expectation was that I should get zero results because indexing is disabled)

And one more thing I'd like to understand - if I enable refresh_interval back to the original value, do I need to execute /_refresh operation ?


Solution

By default, Elasticsearch periodically refreshes indices every second, but only on indices that have received one search request or more in the last 30 seconds. You can change this default interval using the index.refresh_interval setting.

so document says: when you send a search request, it will send a refresh request with that. so you could search your data but very slow for first time or miss some data for first search. it is better to have a refresh_interval if you index new data on your indices.



Answered By - hamid bayat
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

1,213,927

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © 2025 PHPFixing