Java 类org.elasticsearch.action.search.SearchScrollAction 实例源码

项目:elasticsearch_my    文件:AbstractClient.java   
@Override
public ActionFuture<SearchResponse> searchScroll(final SearchScrollRequest request) {
    return execute(SearchScrollAction.INSTANCE, request);
}
项目:elasticsearch_my    文件:AbstractClient.java   
@Override
public void searchScroll(final SearchScrollRequest request, final ActionListener<SearchResponse> listener) {
    execute(SearchScrollAction.INSTANCE, request, listener);
}
项目:elasticsearch_my    文件:AbstractClient.java   
@Override
public SearchScrollRequestBuilder prepareSearchScroll(String scrollId) {
    return new SearchScrollRequestBuilder(this, SearchScrollAction.INSTANCE, scrollId);
}
项目:elasticsearch_my    文件:SearchCancellationIT.java   
public void testCancellationOfScrollSearchesOnFollowupRequests() throws Exception {

        List<ScriptedBlockPlugin> plugins = initBlockFactory();
        indexTestData();

        // Disable block so the first request would pass
        disableBlocks(plugins);

        logger.info("Executing search");
        TimeValue keepAlive = TimeValue.timeValueSeconds(5);
        SearchResponse searchResponse = client().prepareSearch("test")
            .setScroll(keepAlive)
            .setSize(2)
            .setQuery(
                scriptQuery(new Script(
                    ScriptType.INLINE, "native", NativeTestScriptedBlockFactory.TEST_NATIVE_BLOCK_SCRIPT, Collections.emptyMap())))
            .get();

        assertNotNull(searchResponse.getScrollId());

        // Enable block so the second request would block
        for (ScriptedBlockPlugin plugin : plugins) {
            plugin.scriptedBlockFactory.reset();
            plugin.scriptedBlockFactory.enableBlock();
        }

        String scrollId = searchResponse.getScrollId();
        logger.info("Executing scroll with id {}", scrollId);
        ListenableActionFuture<SearchResponse> scrollResponse = client().prepareSearchScroll(searchResponse.getScrollId())
            .setScroll(keepAlive).execute();

        awaitForBlock(plugins);
        cancelSearch(SearchScrollAction.NAME);
        disableBlocks(plugins);

        SearchResponse response = ensureSearchWasCancelled(scrollResponse);
        if (response != null) {
            // The response didn't fail completely - update scroll id
            scrollId = response.getScrollId();
        }
        logger.info("Cleaning scroll with id {}", scrollId);
        client().prepareClearScroll().addScrollId(scrollId).get();
    }
项目:elasticsearch-http    文件:SearchScrollActionHandler.java   
public SearchScrollAction getAction() {
    return SearchScrollAction.INSTANCE;
}