加载query dsl配置文件，在elasticSearch参数对应的es服务器上执行所有操作
@param elasticSearch
@param configFile
@return
425537
public static EventClientUtil getConfigEventRestClientUtil(String elasticSearch,String configFile){
		JavaElasticSearch elasticSearchSink = getJavaElasticSearchSink( elasticSearch);
		return elasticSearchSink.getConfigEventRestClientUtil(configFile);
	}
115432
public <T> ESDatas<T> searchAll(String index,  Class<T> type) throws ElasticSearchException{

		return searchAll(  index,    DEFAULT_FETCHSIZE , type) ;

	}
1112087
public String addDocument(String indexName, String indexType, Object params,ClientOptions clientOptions) throws ElasticSearchException{
		if(params instanceof Map){
			return addMapDocument(indexName,indexType,(Map)params,clientOptions);
		}
		Object docId = null;
		Object parentId = null;
		Object routing = null;
		String refreshOption = null;
		if(clientOptions != null) {
			refreshOption = clientOptions.getRefreshOption();
			ClassUtil.ClassInfo beanClassInfo = ClassUtil.getClassInfo(params.getClass());
			docId = clientOptions.getIdField() != null ? BuildTool.getId(params, beanClassInfo, clientOptions.getIdField()) : null;
			parentId = clientOptions.getParentIdField() != null ? BuildTool.getParentId(params, beanClassInfo, clientOptions.getParentIdField()) : null;
			routing = clientOptions.getRountField() != null ? BuildTool.getRouting(params, beanClassInfo, clientOptions.getRountField()) : null;
		}
		return addDocument(  indexName,   indexType,   params,  docId,  parentId,  routing,  refreshOption);
	}
576921
public TransportsConfiguration getConfiguration(String configFileLocation) {
        TransportsConfiguration transportsConfiguration;

        File file = new File(configFileLocation);
        if (file.exists()) {
            try (Reader in = new InputStreamReader(new FileInputStream(file), StandardCharsets.ISO_8859_1)) {
                Yaml yaml = new Yaml(new CustomClassLoaderConstructor
                        (TransportsConfiguration.class, TransportsConfiguration.class.getClassLoader()));
                yaml.setBeanAccess(BeanAccess.FIELD);
                transportsConfiguration = yaml.loadAs(in, TransportsConfiguration.class);
            } catch (IOException e) {
                throw new RuntimeException(
                        "Error while loading " + configFileLocation + " configuration file", e);
            }
        } else { // return a default config
            LOG.warn("Netty transport configuration file not found in: {} ,hence using default configuration",
                     configFileLocation);
            transportsConfiguration = new TransportsConfiguration();
        }

        return transportsConfiguration;
    }
333053
function index(options) {
  const {
    file,
    config,
    logStart,
    logNotFound,
    logEnd,
    defaultContent = defaultFileContent,
  } = options;

  logger.log(logStart);

  return readConfig(config)
    .then(input => validateExtensions(input))
    .then(input => createStrings(input))
    .then(input => writeExtensionFile({
      input,
      file,
      defaultContent,
      logNotFound,
      logEnd,
    }));
}
1188215
function loadConfigFile(file) {
    const filePath = file.filePath;
    let config;

    switch (path.extname(filePath)) {
        case '.yaml':
        case '.yml':
            config = loadYAMLConfigFile(filePath);
            break;

        default:
            config = loadJSONConfigFile(filePath);
    }

    return ConfigOps.merge(ConfigOps.createEmptyConfig(), config);
}
339455
private static Properties load(String configFilePath)
	{
		Properties props = new Properties();
		BufferedInputStream fis = null;
		try {
			File configFile = new File(configFilePath);
	        fis = new BufferedInputStream(new FileInputStream(configFile));
	        props.load(fis);
        }
        catch(IOException e){
        	System.err.println("Could not load configuration file "+configFilePath);
        }
        finally{
			if(fis!=null){
			    try {
					fis.close();
				}
				catch (IOException e) {
		        	System.err.println("Error closing file stream of configuration file "+configFilePath);
				}
			}
        }
        return props;
	}
889804
@Nullable
  public static String searchPropertiesFile(String propertiesFile,
      String[] confPathList) {
    if (propertiesFile == null || confPathList == null) {
      return null;
    }
    for (String path : confPathList) {
      String file = PathUtils.concatPath(path, propertiesFile);
      Properties properties = loadPropertiesFromFile(file);
      if (properties != null) {
        // If a site conf is successfully loaded, stop trying different paths.
        return file;
      }
    }
    return null;
  }
1351237
public static JKConfig readConfigFile(String configFileName) {
		URL url = getURL(configFileName);
		logger.debug(configFileName + " Url is ", url.toString());
		JKConfig config = new JKConfig(url);
		return config;
	}
524219
public static ClientInterface getRestClientUtil(String elasticSearch){
		ElasticSearch elasticSearchSink = getElasticSearchSink( elasticSearch);
		return elasticSearchSink.getRestClientUtil();
	}
689201
boolean canSearchConfigFile(ServletContext servletContext) {
        String searchConfigFile = servletContext.getInitParameter("searchConfigFile");
        if (searchConfigFile == null || searchConfigFile.equals("")) {
            return false;
        } else if ("true".equals(searchConfigFile)) {
            return true;
        }
        return false;
    }
664917
public String addMapDocument(String indexName,  Map bean, ClientOptions clientOptions) throws ElasticSearchException{
		return addDateMapDocument(  indexName,  _doc,   bean,clientOptions);
	}
352418
public function getAll($configFile = 'default'): ?array
    {
        $this->load($configFile);
        if (!Any::isArray($this->data) || !array_key_exists($configFile, $this->data)) {
            return null;
        }

        return $this->data[$configFile];
    }
1078584
public String addMapDocument(String indexName, String indexType, Map bean) throws ElasticSearchException{
		return addDocument(  indexName,   indexType,   bean,null,null,null,(String )null);
	}
258168
private static ChaincodeCollectionConfiguration fromFile(File configFile, boolean isJson) throws InvalidArgumentException, IOException, ChaincodeCollectionConfigurationException {

        // Sanity check
        if (configFile == null) {
            throw new InvalidArgumentException("configFile must be specified");
        }

        if (logger.isTraceEnabled()) {
            logger.trace(format("ChaincodeCollectionConfiguration.fromFile: %s  isJson = %b", configFile.getAbsolutePath(), isJson));
        }

        // Json file
        try (InputStream stream = new FileInputStream(configFile)) {
            return isJson ? fromJsonStream(stream) : fromYamlStream(stream);
        }

    }
785892
public static function config($configFile = null)
    {
        if (!$configFile && self::$config) {
            return self::$config;
        }

        if (self::$config && self::$lock) {
            return self::$config;
        }

        if ($configFile === null) {
            $configFile = getcwd() . DIRECTORY_SEPARATOR . 'codeception.yml';
        }

        if (is_dir($configFile)) {
            $configFile = $configFile . DIRECTORY_SEPARATOR . 'codeception.yml';
        }

        $dir = realpath(dirname($configFile));
        self::$dir = $dir;

        $configDistFile = $dir . DIRECTORY_SEPARATOR . 'codeception.dist.yml';

        if (!(file_exists($configDistFile) || file_exists($configFile))) {
            throw new ConfigurationException("Configuration file could not be found.\nRun `bootstrap` to initialize Codeception.", 404);
        }

        // Preload config to retrieve params such that they are applied to codeception config file below
        $tempConfig = self::$defaultConfig;

        $distConfigContents = "";
        if (file_exists($configDistFile)) {
            $distConfigContents = file_get_contents($configDistFile);
            $tempConfig = self::mergeConfigs($tempConfig, self::getConfFromContents($distConfigContents, $configDistFile));
        }

        $configContents = "";
        if (file_exists($configFile)) {
            $configContents = file_get_contents($configFile);
            $tempConfig = self::mergeConfigs($tempConfig, self::getConfFromContents($configContents, $configFile));
        }
        self::prepareParams($tempConfig);

        // load config using params
        $config = self::mergeConfigs(self::$defaultConfig, self::getConfFromContents($distConfigContents, $configDistFile));
        $config = self::mergeConfigs($config, self::getConfFromContents($configContents, $configFile));

        if ($config == self::$defaultConfig) {
            throw new ConfigurationException("Configuration file is invalid");
        }

        // we check for the "extends" key in the yml file
        if (isset($config['extends'])) {
            // and now we search for the file
            $presetFilePath = codecept_absolute_path($config['extends']);
            if (file_exists($presetFilePath)) {
                // and merge it with our configuration file
                $config = self::mergeConfigs(self::getConfFromFile($presetFilePath), $config);
            }
        }

        self::$config = $config;

        // compatibility with suites created by Codeception < 2.3.0
        if (!isset($config['paths']['output']) and isset($config['paths']['log'])) {
            $config['paths']['output'] = $config['paths']['log'];
        }

        if (isset(self::$config['actor'])) {
            self::$config['actor_suffix'] = self::$config['actor']; // old compatibility
        }

        if (!isset($config['paths']['support']) and isset($config['paths']['helpers'])) {
            $config['paths']['support'] = $config['paths']['helpers'];
        }

        if (!isset($config['paths']['output'])) {
            throw new ConfigurationException('Output path is not defined by key "paths: output"');
        }

        self::$outputDir = $config['paths']['output'];

        // fill up includes with wildcard expansions
        $config['include'] = self::expandWildcardedIncludes($config['include']);

        // config without tests, for inclusion of other configs
        if (count($config['include'])) {
            self::$config = $config;
            if (!isset($config['paths']['tests'])) {
                 return $config;
            }
        }

        if (!isset($config['paths']['tests'])) {
            throw new ConfigurationException(
                'Tests directory is not defined in Codeception config by key "paths: tests:"'
            );
        }

        if (!isset($config['paths']['data'])) {
            throw new ConfigurationException('Data path is not defined Codeception config by key "paths: data"');
        }

        if (!isset($config['paths']['support'])) {
            throw new ConfigurationException('Helpers path is not defined by key "paths: support"');
        }

        self::$dataDir = $config['paths']['data'];
        self::$supportDir = $config['paths']['support'];
        self::$testsDir = $config['paths']['tests'];

        if (isset($config['paths']['envs'])) {
            self::$envsDir = $config['paths']['envs'];
        }

        Autoload::addNamespace(self::$config['namespace'], self::supportDir());
        self::loadBootstrap($config['settings']['bootstrap']);
        self::loadSuites();

        return $config;
    }
648805
def default_search_factory(self, search, query_parser=None):
    
    def _default_parser(qstr=None):
        """Default parser that uses the Q() from elasticsearch_dsl."""
        if qstr:
            return Q('query_string', query=qstr)
        return Q()

    from .facets import default_facets_factory
    from .sorter import default_sorter_factory

    query_string = request.values.get('q')
    query_parser = query_parser or _default_parser

    try:
        search = search.query(query_parser(query_string))
    except SyntaxError:
        current_app.logger.debug(
            "Failed parsing query: {0}".format(
                request.values.get('q', '')),
            exc_info=True)
        raise InvalidQueryRESTError()

    search_index = search._index[0]
    search, urlkwargs = default_facets_factory(search, search_index)
    search, sortkwargs = default_sorter_factory(search, search_index)
    for key, value in sortkwargs.items():
        urlkwargs.add(key, value)

    urlkwargs.add('q', query_string)
    return search, urlkwargs