Disjunction and Conjunction restrictions similar to sunspot solr?


(Karan Verma) #1

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.
To view this discussion on the web visit 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.


(David Pilato) #2

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

Does it help?

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

Le 12 déc. 2013 à 03:53, Karan Verma 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.
To view this discussion on the web visit 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.

--
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.
To view this discussion on the web visit 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.


(system) #3