Creates a search request from a search filter.

@param filter LDAP search filter.
@return ldaptive search request.
975722
private SearchRequest createRequest(final SearchFilter filter) {
        final SearchRequest request = new SearchRequest();
        request.setBaseDn(this.baseDN);
        request.setSearchFilter(filter);

        /** LDAP attributes to fetch from search results. */
        if (getResultAttributeMapping() != null && !getResultAttributeMapping().isEmpty()) {
            final String[] attributes = getResultAttributeMapping().keySet().toArray(new String[getResultAttributeMapping().size()]);
            request.setReturnAttributes(attributes);
        } else if (searchControls.getReturningAttributes() != null && searchControls.getReturningAttributes().length > 0) {
            request.setReturnAttributes(searchControls.getReturningAttributes());
        } else {
            request.setReturnAttributes(ReturnAttributes.ALL_USER.value());
        }

        request.setSearchScope(this.searchScope);
        request.setSizeLimit(this.searchControls.getCountLimit());
        request.setTimeLimit(Duration.ofSeconds(searchControls.getTimeLimit()));
        return request;
    }
590252
public static <E> Filter<E> notFilter(Filter<E> filter) {
    return (new NegatedFilter<E>(filter));
  }
891703
public static linkset[] get_filtered(nitro_service service, String filter) throws Exception{
		linkset obj = new linkset();
		options option = new options();
		option.set_filter(filter);
		linkset[] response = (linkset[]) obj.getfiltered(service, option);
		return response;
	}
1013751
public Task<DocumentT> findOneAndDelete(final Bson filter) {
    return dispatcher.dispatchTask(new Callable<DocumentT>() {
      @Override
      public DocumentT call() {
        return proxy.findOneAndDelete(filter);
      }
    });
  }
490682
public static sslaction[] get_filtered(nitro_service service, String filter) throws Exception{
		sslaction obj = new sslaction();
		options option = new options();
		option.set_filter(filter);
		sslaction[] response = (sslaction[]) obj.getfiltered(service, option);
		return response;
	}
905605
def _post_filter(search, urlkwargs, definitions):
    """"""
    filters, urlkwargs = _create_filter_dsl(urlkwargs, definitions)

    for filter_ in filters:
        search = search.post_filter(filter_)

    return (search, urlkwargs)
753295
public static sslcrl[] get_filtered(nitro_service service, String filter) throws Exception{
		sslcrl obj = new sslcrl();
		options option = new options();
		option.set_filter(filter);
		sslcrl[] response = (sslcrl[]) obj.getfiltered(service, option);
		return response;
	}
1120406
public static Interface[] get_filtered(nitro_service service, String filter) throws Exception{
		Interface obj = new Interface();
		options option = new options();
		option.set_filter(filter);
		Interface[] response = (Interface[]) obj.getfiltered(service, option);
		return response;
	}
464336
public function getSearchRequest($filter, $limit = 1, $conditions = [])
    {
        if (isset($filter['id'])) {
            $ids = is_array($filter['id']) ? $filter['id'] : [$filter['id']];
            return $this->getReadRequest($ids);
        }
        
        return new StorageDataRequest();
    }
127048
public static SearchRequest newSearchRequest(final String baseDn, final SearchFilter filter) {
        final SearchRequest sr = new SearchRequest(baseDn, filter);
        sr.setBinaryAttributes(ReturnAttributes.ALL_USER.value());
        sr.setReturnAttributes(ReturnAttributes.ALL_USER.value());
        sr.setSearchScope(SearchScope.SUBTREE);
        return sr;
    }
1335655
private SearchFilter getSearchFilter(HttpServletRequest httpServletRequest) {
        SearchFilter ret = new SearchFilter();
        Set<String> keySet = httpServletRequest.getParameterMap().keySet();
        for (String key : keySet) {
            ret.setParam(String.valueOf(key), String.valueOf(httpServletRequest.getParameter(key)));
        }

        return ret;
    }
819434
public FilterBuilder<T> addWithOr(final Filter<T> filter) {
    filterInstance = ComposableFilter.or(filterInstance, filter);
    return this;
  }
335565
public FilterType<WebAppDescriptor> getOrCreateFilter()
   {
      List<Node> nodeList = model.get("filter");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FilterTypeImpl<WebAppDescriptor>(this, "filter", model, nodeList.get(0));
      }
      return createFilter();
   }
1337345
public static systemuser[] get_filtered(nitro_service service, String filter) throws Exception{
		systemuser obj = new systemuser();
		options option = new options();
		option.set_filter(filter);
		systemuser[] response = (systemuser[]) obj.getfiltered(service, option);
		return response;
	}
1051985
public function getSearchRequest($filter, $limit = 1, $conditions = [])
    {
        $self = $this;
        $knownFilters = $this->_getSearchFilters();
        $request = new StorageDataRequest(
            [$filter, $limit, $conditions],
            function ($filter, $limit, $conditions) use ($self, $knownFilters) {
                $items = $self->getAllItems();
                $results = [];
                $filterRules = [];
                
                foreach ($filter as $filterRequest) {
                    if (\count($filterRequest) === 3) {
                        list ($key, $compare, $compareValue) = $filterRequest;
                        
                        if (isset($knownFilters[$compare])) {
                            $filterRules[] = [$key, $knownFilters[$compare], $compareValue];
                        } else {
                            trigger_error('Comparator not found for filter: '.json_encode($filterRequest).'');
                        }
                    } else {
                        trigger_error('Strange filter: less than 3 parameters, '.json_encode($filterRequest));
                    }
                }
                
                foreach ($items as $id) {
                    $pointer = $self->getPointer($id);
                    $isOk = true;
                    if ($pointer) {
                        $record = json_decode(stream_get_contents($pointer), true);
                        
                        if (isset($record[self::F_DATA])) {
                            foreach ($filterRules as $filterRule) {
                                list ($key, $function, $filterRequest) = $filterRule;
        
                                $isOk = $isOk && call_user_func($function, $record[self::F_DATA][$key] ?? null, $filterRequest);
        
                                if (!$isOk) {
                                    break;
                                }
                            }
    
                            if ($isOk) {
                                $results[$id] = [$this->primaryKey => $id] + $record[self::F_DATA];
                            }    
                        }
                        
                        $self->closePointer($pointer);
                        
                        if (count($results) >= $limit) {
                            break;
                        }
                    }
                }
                
                if ($results && $conditions) {
                    $self->applyConditions($results, $conditions);
                }
            
                return $results;
            }
        );
    
        return $request;
    }
150154
public Collection<Request> getRequests(RequestFilter filter) {
        filter = (filter != null) ? filter : new RequestFilter();

        filter.issues.clear();
        filter.issues.add(this);
        return getInstance().get().requests(filter);
    }
212175
public Query<S> query(String filter) throws FetchException {
        synchronized (mStringToQuery) {
            Query<S> query = mStringToQuery.get(filter);
            if (query == null) {
                if (filter == null) {
                    throw new IllegalArgumentException("Query filter must not be null");
                }
                query = query(Filter.filterFor(mType, filter), null);
                mStringToQuery.put(filter, query);
            }
            return query;
        }
    }