Getting the registered symbols

If a symbol has performed the buildAnalyticsModel workflow successfully, then the symbol is stored in the register_funds index and treated as registered. To update all the registered symbols, we need to know all the registered symbols. The getRegisterFunds() method from the EsDataService Spring Bean is used to get all the registered symbols. To perform a search request to retrieve all symbols, we construct a SearchRequest object, which embeds a SearchSourceBuilder object to create a match all query. The following code block shows the source code: 

SearchRequest request = new SearchRequest(registerIndexName);
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
RequestOptions options = RequestOptions.DEFAULT; request.source(sourceBuilder.query(
QueryBuilders.matchAllQuery()).sort("symbol", SortOrder.DESC));
......
response = restClient.search(request, options);

In the next section, we will discuss the final task: building the scheduler to update data automatically. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.51.16