# Greater Than/Less Than filters on facets

**URL:** https://discuss.elastic.co/t/greater-than-less-than-filters-on-facets/278911
**Category:** Elastic Search
**Tags:** elastic-site-search
**Created:** [July 16, 2021, 1:47pm UTC](https://discuss.elastic.co/t/greater-than-less-than-filters-on-facets/278911 "2021-07-16T13:47:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![eric\_m1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_m1/32/91750_2.png) [@eric\_m1](https://discuss.elastic.co/u/eric_m1)
#### Post date: [July 16, 2021, 1:47pm UTC](https://discuss.elastic.co/t/greater-than-less-than-filters-on-facets/278911/1 "2021-07-16T13:47:48Z")

</div>

Is there a way to filter results where a facet value is \>= or \<= a given value?

---

<div class="post-metadata">

### Author: ![ross.bell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ross.bell/32/77559_2.png) [@ross.bell](https://discuss.elastic.co/u/ross.bell)
#### Post date: [July 16, 2021, 3:23pm UTC](https://discuss.elastic.co/t/greater-than-less-than-filters-on-facets/278911/2 "2021-07-16T15:23:49Z")

</div>

Hey @eric_m1,

Could you clarify which product you're asking about? If you're asking about [Site Search](https://swiftype.com/), as the post is tagged, then you might be looking for these docs: [Filtering | Swiftype Documentation](https://swiftype.com/documentation/site-search/searching/filtering#range_queries).

---

<div class="post-metadata">

### Author: ![eric\_m1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_m1/32/91750_2.png) [@eric\_m1](https://discuss.elastic.co/u/eric_m1)
#### Post date: [July 16, 2021, 4:54pm UTC](https://discuss.elastic.co/t/greater-than-less-than-filters-on-facets/278911/3 "2021-07-16T16:54:03Z")

</div>

Hi @ross.bell ,

It is for Site Search. I have looked at the documentation you linked to before field types supported included integer and I know we can filter where the value is in a range but if we had a field such as ports and wanted to get results were ports was \>= 5 is there a way to do this?

---

<div class="post-metadata">

### Author: ![ross.bell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ross.bell/32/77559_2.png) [@ross.bell](https://discuss.elastic.co/u/ross.bell)
#### Post date: [July 16, 2021, 6:49pm UTC](https://discuss.elastic.co/t/greater-than-less-than-filters-on-facets/278911/4 "2021-07-16T18:49:19Z")

</div>

You don't have to specify both ends of a range filter. You could use something like:

```json
"ports":{
  "type": "range",
  "from": 5
}

```

In the above case, `ports` needs to be of type _integer_ or _float_.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [August 17, 2021, 12:56pm UTC](https://discuss.elastic.co/t/greater-than-less-than-filters-on-facets/278911/6 "2021-08-17T12:56:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
