EvilJinious1
EvilJinious1

Reputation: 2841

set the value of index.max_result_window

as the title says, how do I set this from within my spring data elasticsearch applciaiton (spring boot)?

I can see in the exception traces that it is set to 10000. I need slightly more.

Upvotes: 1

Views: 2627

Answers (2)

user5101998
user5101998

Reputation: 219

Simply an entry in your application.properties:

spring.data.elasticsearch.properties.index.max_result_window=15000

Upvotes: 2

Eric Hans
Eric Hans

Reputation: 383

If you want to increase the max_result_window, you should set this property when creating your index. Using spring boot, you can have something like this (Example for max_result_window = 15000:

@SpringBootApplication
public class MainClass implements CommandLineRunner {

    @Autowired
    public ElasticsearchTemplate elasticsearchTemplate;

    public static void main(String[] args) {
        SpringApplication.run(MainClass.class).close()
    }

    @Override
    public void run(String... args) throws Exception {
        elasticsearchTemplate.createIndex(Entity.class, "max_result_window = 15000");
}

Upvotes: 1

Related Questions