public static String sqlToEsQuery(String sql) throws Exception { Map actions = new HashMap(); Settings settings = Settings.builder().build(); // Client client = new NodeClient(settings, null, null, actions); // Settings.builder() // .put(ThreadContext.PREFIX + ".key1", "val1") // .put(ThreadContext.PREFIX + ".key2", "val 2") // .build(); ThreadPool threadPool = new ThreadPool(settings); Client client = new NodeClient(settings, threadPool); SearchDao searchDao = new org.nlpcn.es4sql.SearchDao(client); try { return searchDao.explain(sql).explain().explain(); } catch (Exception e) { throw e; } }
additionalSettings.addAll(builder.getRegisteredSettings()); client = new NodeClient(settings, threadPool); final ResourceWatcherService resourceWatcherService = new ResourceWatcherService(settings, threadPool); final ScriptModule scriptModule = new ScriptModule(settings, pluginsService.filterPlugins(ScriptPlugin.class));
public static String sqlToEsQuery(String sql) throws Exception { Map actions = new HashMap(); Settings settings = Settings.builder().build(); // Client client = new NodeClient(settings, null, null, actions); // Settings.builder() // .put(ThreadContext.PREFIX + ".key1", "val1") // .put(ThreadContext.PREFIX + ".key2", "val 2") // .build(); ThreadPool threadPool = new ThreadPool(settings); Client client = new NodeClient(settings, threadPool); SearchDao searchDao = new org.nlpcn.es4sql.SearchDao(client); try { return searchDao.explain(sql).explain().explain(); } catch (Exception e) { throw e; } }
additionalSettings.addAll(builder.getRegisteredSettings()); client = new NodeClient(settings, threadPool); final ResourceWatcherService resourceWatcherService = new ResourceWatcherService(settings, threadPool); final ScriptModule scriptModule = ScriptModule.create(settings, this.environment, resourceWatcherService,
additionalSettings.addAll(builder.getRegisteredSettings()); client = new NodeClient(settings, threadPool); final ResourceWatcherService resourceWatcherService = new ResourceWatcherService(settings, threadPool); final ScriptModule scriptModule = new ScriptModule(settings, pluginsService.filterPlugins(ScriptPlugin.class));
additionalSettings.addAll(builder.getRegisteredSettings()); client = new NodeClient(settings, threadPool); final ResourceWatcherService resourceWatcherService = new ResourceWatcherService(settings, threadPool); final ScriptModule scriptModule = new ScriptModule(settings, pluginsService.filterPlugins(ScriptPlugin.class));