# 搜索中的排除条件

**URL:** <https://meta.discourse.org/t/excluding-criteria-in-search/50056>\
**Category:** Feature\
**Created:** [2016年九月13日 01:45 UTC](https://meta.discourse.org/t/excluding-criteria-in-search/50056 "2016-09-13T01:45:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jesselperry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jesselperry/32/119501_2.png) [@jesselperry](https://meta.discourse.org/u/jesselperry)\
**Post date:** [2016年九月13日 01:45 UTC](https://meta.discourse.org/t/excluding-criteria-in-search/50056/1 "2016-09-13T01:45:48Z")

</div>

我四处搜索（双关语），但没找到答案。有没有办法在搜索时排除某些选项？例如，使用 `-@jesselperry` 来排除我发布的帖子，或者使用 `-#contribute:feature` 来排除“feature”分类下的所有结果？

---

<div class="post-metadata">

**Author:** ![dmacjam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dmacjam/32/67659_2.png) [@dmacjam](https://meta.discourse.org/u/dmacjam)\
**Post date:** [2017年四月5日 15:40 UTC](https://meta.discourse.org/t/excluding-criteria-in-search/50056/2 "2017-04-05T15:40:07Z")

</div>

I think it is good idea to add this as a new advanced search feature. I would suggest using additional format for search filters, similar to what it is used in [Github search](https://help.github.com/articles/search-syntax/#filter-qualifiers-based-on-exclusion). It follows advanced filters formats which are also used as an alternative in Discourse advanced search:

- -user:dmacjam
- -category:feature
- -tags:plugins,sso

---

<div class="post-metadata">

**Author:** ![pipkin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pipkin/32/134643_2.png) [@pipkin](https://meta.discourse.org/u/pipkin)\
**Post date:** [2019年三月30日 12:57 UTC](https://meta.discourse.org/t/excluding-criteria-in-search/50056/3 "2019-03-30T12:57:30Z")

</div>

This has been implemented, for tags at least:

> [@New search operator "not" for tags only](https://meta.discourse.org/t/new-search-operator-not/52087/32):
>
> @tgxworld Do you mean splitting on -tags: instead of -? So for more complex example: tags:eggs+beacon -tags:lunch,sandwiches it would search for posts with eggs and beacon tags, but without lunch and without sandwiches tags? Then, I think it would be a quick change.
