Mark the filter as being ordered if search has occurred.
197240
def order_by(self, *field_names):
        
        if not self._search_ordered:
            self._search_ordered = len(self._search_terms) > 0
        return super(SearchableQuerySet, self).order_by(*field_names)
1313204
void updateSearchResults(boolean selectFirstMatch)
    {
        clearHighlights();
        searchPanel.setMessage("");
        
        String query = searchPanel.getQuery();

        if (query.isEmpty())
        {
            handleMatch(null);
            return;
        }
        
        String text = getDocumentText();
        boolean ignoreCase = !searchPanel.isCaseSensitive();
        List<Point> appearances = 
            JTextComponents.find(text, query, ignoreCase);
        addHighlights(appearances, highlightColor);

        int caretPosition = textComponent.getCaretPosition();
        Point match = JTextComponents.findNext(
            text, query, caretPosition, ignoreCase);
        if (match == null)
        {
            match = JTextComponents.findNext(
                text, query, 0, ignoreCase);
        }
        if (selectFirstMatch)
        {
            handleMatch(match);
        }
        else
        {
            handleMatch(null);
        }

        if (appearances.isEmpty())
        {
            searchPanel.setMessage("Not found");
        }
        else
        {
            searchPanel.setMessage(
                "Found " + appearances.size() + " times");
        }
    }
911517
def _orderedCleanDict(attrsObj):
    
    def _filt(k, v):
        if attr.has(v):
            return not not any(attr.astuple(v))
        return not not v

    return attr.asdict(attrsObj,
        dict_factory=OrderedDict,
        recurse=False,
        filter=_filt)
715266
function() {
			var self = this;
	
			self.loadedSearches = {};
			self.userOptions = {};
			self.renderCache = {};
			self.options = self.sifter.items = {};
			self.lastQuery = null;
			self.trigger('option_clear');
			self.clear();
		}
829315
def filter(self, search):
        
        if not self._filters:
            return search

        post_filter = MatchAll()
        for f in itervalues(self._filters):
            post_filter &= f
        return search.post_filter(post_filter)
854872
def order_search(self, search):
        
        ordering = self.get_query_param('ordering', self.ordering)
        if not ordering:
            return search

        sort_fields = []
        for raw_ordering in ordering.split(','):
            ordering_field = raw_ordering.lstrip('-')
            if ordering_field not in self.ordering_fields:
                raise ParseError('Ordering by `{}` is not supported.'.format(ordering_field))

            ordering_field = self.ordering_map.get(ordering_field, ordering_field)
            direction = '-' if raw_ordering[0] == '-' else ''
            sort_fields.append('{}{}'.format(direction, ordering_field))

        return search.sort(*sort_fields)
803911
def simple_filter(self, key, value):
        ""
        searched = {key: value}
        return set([k for k, v in self.data.items() if
                    intersect(searched, v) == searched])
175439
def orders_after(self, other, *, visited=None):
        
        return self.orders_after_any(frozenset([other]), visited=visited)
754601
public static Boolean isAscendingOrder(String sorting) {
        return "desc".equalsIgnoreCase(sorting) ? Boolean.FALSE : Boolean.TRUE;
    }
696541
def filter_queryset(self, request, queryset, view):
        "
        self.ordering_param = view.SORT

        ordering = self.get_ordering(request, queryset, view)
        if ordering:
            return queryset.order_by(*ordering)

        return queryset
748561
def stanza_filter(filter_, func, order=_Undefined):
    
    if order is not _Undefined:
        return filter_.context_register(func, order)
    else:
        return filter_.context_register(func)
1220506
def ordered(self, ord='desc'):
        """"""
        if ord not in ('asc', 'desc', ):
            raise
        ord_f = getattr(PIDRelation.index, ord)()
        return self.order_by(ord_f)
710699
def Filter(self, match=None, **_):
    """"""
    arg = self.stack.pop(-1)

    # Filters can be specified as a comma separated list.
    for filter_name in match.group(1).split(","):
      filter_object = ConfigFilter.classes_by_name.get(filter_name)
      if filter_object is None:
        raise FilterError("Unknown filter function %r" % filter_name)

      if not filter_object.sensitive_arg:
        logging.debug("Applying filter %s for %s.", filter_name, arg)
      arg = filter_object().Filter(arg)
      precondition.AssertType(arg, Text)

    self.stack[-1] += arg
577800
@SuppressWarnings("unchecked")
    public Q filter(Filter filter) {
        if (filters.isEmpty()) {
            this.filter = filter;
            filters = ImmutableList.of(filter);
        } else {
            this.filter = null;
            if (filters.size() == 1) {
                filters = new ArrayList<Filter>();
            }
            filters.add(filter);
        }
        return (Q) this;
    }
52592
def search_complete(self, completed):
        """"""
        self.result_browser.set_sorting(ON)
        self.find_options.ok_button.setEnabled(True)
        self.find_options.stop_button.setEnabled(False)
        self.status_bar.hide()
        self.result_browser.expandAll()
        if self.search_thread is None:
            return
        self.sig_finished.emit()
        found = self.search_thread.get_results()
        self.stop_and_reset_thread()
        if found is not None:
            results, pathlist, nb, error_flag = found
            self.result_browser.show()
937104
async def notify(self, *args):
        
        from .filters import check_filters, FilterNotPassed

        results = []

        data = {}
        ctx_data.set(data)

        if self.middleware_key:
            try:
                await self.dispatcher.middleware.trigger(f"pre_process_{self.middleware_key}", args + (data,))
            except CancelHandler:  # Allow to cancel current event
                return results

        try:
            for handler_obj in self.handlers:
                try:
                    data.update(await check_filters(handler_obj.filters, args))
                except FilterNotPassed:
                    continue
                else:
                    ctx_token = current_handler.set(handler_obj.handler)
                    try:
                        if self.middleware_key:
                            await self.dispatcher.middleware.trigger(f"process_{self.middleware_key}", args + (data,))
                        partial_data = _check_spec(handler_obj.spec, data)
                        response = await handler_obj.handler(*args, **partial_data)
                        if response is not None:
                            results.append(response)
                        if self.once:
                            break
                    except SkipHandler:
                        continue
                    except CancelHandler:
                        break
                    finally:
                        current_handler.reset(ctx_token)
        finally:
            if self.middleware_key:
                await self.dispatcher.middleware.trigger(f"post_process_{self.middleware_key}",
                                                         args + (results, data,))

        return results
122923
def filter(self, record):
        """"""
        fmt = LogManager.spec.context_format
        if fmt:
            data = self.context.to_dict()
            if data:
                record.context = fmt % ",".join("%s=%s" % (key, val) for key, val in sorted(data.items()) if key and val)
            else:
                record.context = ""
        return True