# Disjunction and Conjunction restrictions similar to sunspot solr?

**URL:** <https://discuss.elastic.co/t/disjunction-and-conjunction-restrictions-similar-to-sunspot-solr/14832>\
**Category:** Elasticsearch\
**Created:** [December 12, 2013, 2:53am UTC](https://discuss.elastic.co/t/disjunction-and-conjunction-restrictions-similar-to-sunspot-solr/14832 "2013-12-12T02:53:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karan\_Verma](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@Karan\_Verma](https://discuss.elastic.co/u/Karan_Verma)\
**Post date:** [December 12, 2013, 2:53am UTC](https://discuss.elastic.co/t/disjunction-and-conjunction-restrictions-similar-to-sunspot-solr/14832/1 "2013-12-12T02:53:55Z")

</div>

Hello

I am trying to achieve the restrictions defined below in sunspot solr  
documentation. Is there a way to do that with ES? Thanks!

Disjunctions and Conjunctions

# Posts that do not have an expired time or have not yet expired

Post.search  
do  
any\_of do  
with(:expired\_at).greater\_than(Time.now)  
with(:expired\_at, nil)  
end  
end

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4cb4ccf4-65ac-478b-a126-2d3a7cf0eb06%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4cb4ccf4-65ac-478b-a126-2d3a7cf0eb06%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 12, 2013, 7:05am UTC](https://discuss.elastic.co/t/disjunction-and-conjunction-restrictions-similar-to-sunspot-solr/14832/2 "2013-12-12T07:05:49Z")

</div>

It looks like to me as a OrFilter with two clauses:  
missingFilter  
RangeFilter

Does it help?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 12 déc. 2013 à 03:53, Karan Verma [karan@healthtap.com](mailto:karan@healthtap.com) a écrit :

> Hello
> 
> I am trying to achieve the restrictions defined below in sunspot solr documentation. Is there a way to do that with ES? Thanks!
> 
> Disjunctions and Conjunctions
> 
> # Posts that do not have an expired time or have not yet expired
> 
> ## Post.search do any\_of do with(:expired\_at).greater\_than(Time.now) with(:expired\_at, nil) end end
> 
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4cb4ccf4-65ac-478b-a126-2d3a7cf0eb06%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4cb4ccf4-65ac-478b-a126-2d3a7cf0eb06%40googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7B47C14A-B685-4396-9B87-136A98B4AE48%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/7B47C14A-B685-4396-9B87-136A98B4AE48%40pilato.fr).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:01am UTC](https://discuss.elastic.co/t/disjunction-and-conjunction-restrictions-similar-to-sunspot-solr/14832/3 "2017-07-06T02:01:43Z")

</div>


