New search executor search executor.

@param baseDn      the base dn
@param filterQuery the filter query
@return the search executor
961262
public static SearchExecutor newLdaptiveSearchExecutor(final String baseDn, final String filterQuery) {
        return newLdaptiveSearchExecutor(baseDn, filterQuery, new ArrayList<>(0));
    }
1349636
public SortedMap<String, HealthCheck.Result> runHealthChecks(ExecutorService executor, HealthCheckFilter filter) {
        final Map<String, Future<HealthCheck.Result>> futures = new HashMap<>();
        for (final Map.Entry<String, HealthCheck> entry : healthChecks.entrySet()) {
            final String name = entry.getKey();
            final HealthCheck healthCheck = entry.getValue();
            if (filter.matches(name, healthCheck)) {
                futures.put(name, executor.submit(() -> healthCheck.execute()));
            }
        }

        final SortedMap<String, HealthCheck.Result> results = new TreeMap<>();
        for (Map.Entry<String, Future<Result>> entry : futures.entrySet()) {
            try {
                results.put(entry.getKey(), entry.getValue().get());
            } catch (Exception e) {
                LOGGER.warn("Error executing health check {}", entry.getKey(), e);
                results.put(entry.getKey(), HealthCheck.Result.unhealthy(e));
            }
        }

        return Collections.unmodifiableSortedMap(results);
    }
589523
function searchDeletedObjects(baseDN, opts) {
    search.call(self, baseDN, _.defaults({}, opts, { includeDeleted: true }), function onFind(err, results) {
      if (err) {
        if (callback) callback(err);
        return;
      }

      if ((! results) || (results.length === 0)) {
        log.warn('No deleted objects found for query "%s"', truncateLogOutput(opts.filter));
        if (callback) callback();
        self.emit('done');
        return;
      }

      var deletedItems = [];

      // Parse the results in parallel.
      _.forEach(deletedItemss, function(item) {
        var deletedItem = pickAttributes(item, (opts | {}).attributes || []);
        self.emit('entry:deleted', deletedItem);
        deletedItems.push(deletedItem);
      });

      log.info('%d deleted objects found for query "%s". Results: %j',
               deletedItems.length, truncateLogOutput(localOpts.filter), deletedItems);
      self.emit('deleted', deletedItems);
      if (callback) callback(null, deletedItems);
    });
  }
1242490
public QueryExecutor<S> executor(Filter<S> filter, OrderingList<S> ordering, QueryHints hints)
        throws RepositoryException
    {
        return analyze(filter, ordering, hints).createExecutor();
    }
173158
public BasicDBObject createMongoQuery(EntityMetadata m, Queue filterClauseQueue)
    {
        QueryComponent sq = getQueryComponent(filterClauseQueue);
        populateQueryComponents(m, sq);
        return sq.actualQuery == null ? new BasicDBObject() : sq.actualQuery;
    }
312290
public static Specification<JpaTargetFilterQuery> equalsQuery(final String queryValue) {
        return (targetFilterQueryRoot, query, cb) -> cb.equal(targetFilterQueryRoot.get(JpaTargetFilterQuery_.query),
                queryValue);
    }
807995
private static QueryBuilder buildQuery(RuleQuery query) {

    // No contextual query case
    String queryText = query.getQueryText();
    if (StringUtils.isEmpty(queryText)) {
      return matchAllQuery();
    }

    // Build RuleBased contextual query
    BoolQueryBuilder qb = boolQuery();
    String queryString = query.getQueryText();

    if (queryString != null && !queryString.isEmpty()) {
      BoolQueryBuilder textQuery = boolQuery();
      JavaTokenizer.split(queryString)
        .stream().map(token -> boolQuery().should(
          matchQuery(
            SEARCH_GRAMS_ANALYZER.subField(FIELD_RULE_NAME),
            StringUtils.left(token, DefaultIndexSettings.MAXIMUM_NGRAM_LENGTH)).boost(20f))
          .should(
            matchPhraseQuery(
              ENGLISH_HTML_ANALYZER.subField(FIELD_RULE_HTML_DESCRIPTION),
              token).boost(3f)))
        .forEach(textQuery::must);
      qb.should(textQuery.boost(20f));
    }

    // Match and partial Match queries
    // Search by key uses the "sortable" sub-field as it requires to be case-insensitive (lower-case filtering)
    qb.should(matchQuery(SORTABLE_ANALYZER.subField(FIELD_RULE_KEY), queryString).operator(Operator.AND).boost(30f));
    qb.should(matchQuery(SORTABLE_ANALYZER.subField(FIELD_RULE_RULE_KEY), queryString).operator(Operator.AND).boost(15f));
    qb.should(termQuery(FIELD_RULE_LANGUAGE, queryString, 3f));
    return qb;
  }
143951
private ExecutorService createQueryExecutor() {
		ThreadFactory threadFactory = new ThreadFactoryBuilder()
				.setDaemon(true)
				.setNameFormat("Flink " + getServerName() + " Thread %d")
				.build();
		return Executors.newFixedThreadPool(numQueryThreads, threadFactory);
	}
682464
public function search(SearchCondition\SearchConditionInterface $filter, SelectOrder\SelectOrderInterface $order = null)
	{
		$qb = $this->createSearchQueryBuilder($filter, $order);

		$result = $qb->getQuery()
				->getResult();
		
		return $result;
	}
347037
public boolean performBooleanQuery(String queryString, SPARQLQueryBindingSet bindings, Transaction tx, boolean includeInferred, String baseURI) {
        SPARQLQueryDefinition qdef = sparqlManager.newQueryDefinition(queryString);
        if(notNull(baseURI) && !baseURI.isEmpty()){ qdef.setBaseUri(baseURI);}
        qdef.setIncludeDefaultRulesets(includeInferred);
        if (notNull(ruleset)) {qdef.setRulesets(ruleset);}
        if (notNull(getConstrainingQueryDefinition())){
        	qdef.setConstrainingQueryDefinition(getConstrainingQueryDefinition());
            qdef.setDirectory(getConstrainingQueryDefinition().getDirectory());
            qdef.setCollections(getConstrainingQueryDefinition().getCollections());
            qdef.setResponseTransform(getConstrainingQueryDefinition().getResponseTransform());
            qdef.setOptionsName(getConstrainingQueryDefinition().getOptionsName());
        	}
        if(notNull(graphPerms)){ qdef.setUpdatePermissions(graphPerms);}
        return sparqlManager.executeAsk(qdef,tx);
    }
317400
public function setQuery($query, $baseDn)
    {
        $this->query = $query;
        $this->baseDn = $baseDn;

        $this->message = "No LDAP query results for filter: [{$query}] in: [{$baseDn}]";

        return $this;
    }
422718
public static FilterBuilder buildFilter(Criteria criteria) {
        if (criteria.getTransaction() != null && criteria.getTransaction().trim().isEmpty()) {
            return FilterBuilders.missingFilter(TRANSACTION_FIELD);
        }
        return null;
    }
881225
public function actionFilter($filterName, $query = null)
    {
        $this->checkAccess('filter');
        
        $model = $this->model;
        
        $filterName = Html::encode($filterName);
        
        if (!array_key_exists($filterName, $model->ngRestFilters())) {
            throw new InvalidCallException("The requested filter '$filterName' does not exists in the filter list.");
        }

        $find = $model->ngRestFilters()[$filterName];

        if ($query) {
            foreach ($model->getNgRestPrimaryKey() as $pkName) {
                $searchQuery = $model->ngRestFullQuerySearch($query)->select([$model->tableName() . '.' . $pkName]);
                $find->andWhere(['in', $model->tableName() . '.' . $pkName, $searchQuery]);
            }
        }

        $this->appendPoolWhereCondition($find);
        
        return new ActiveDataProvider([
            'query' => $find,
            'pagination' => $this->pagination,
            'sort' => [
                'attributes' => $this->generateSortAttributes($model->getNgRestConfig()),
            ]
        ]);
    }
1191206
public static DependencyQueryBuilder create(DependencyQuery query)
   {
      DependencyQueryBuilder builder = new DependencyQueryBuilder();
      builder.setCoordinate(query.getCoordinate());
      builder.setFilter(query.getDependencyFilter());
      builder.setRepositories(query.getDependencyRepositories());
      builder.setScopeType(query.getScopeType());
      return builder;
   }
882880
public QueryRequestBuilder<T,ID> query(QueryExpression query)
    {
        return new QueryRequestBuilder<T, ID>(version,type,entityName,query.build());
    }
215265
@When("^I search in LDAP using the filter '(.+?)' and the baseDn '(.+?)'$")
    public void searchLDAP(String filter, String baseDn) throws Exception {
        this.commonspec.setPreviousLdapResults(commonspec.getLdapUtils().search(new SearchRequest(baseDn, filter)));
    }
442327
public boolean searchBase(String base, String filter) throws NamingException {
    return search(base, filter, scopeBase);
  }