Groups
Groups
Sign in
Groups
Groups
Elastictastic
Conversations
About
Send feedback
Help
Search with range on field
9 views
Skip to first unread message
Christophe Moins
unread,
Nov 13, 2012, 11:49:31 AM
11/13/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to elasti...@googlegroups.com
Hi
I'm trying to make a query with a range on a field, for example for a price between $10 adn $20
I can't find anything about this on elastictastic documentation.
Is there someone to help me?
Thanks
Matthew A. Brown
unread,
Nov 13, 2012, 11:59:46 AM
11/13/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to elasti...@googlegroups.com
Hi Christophe,
Elastictastic doesn't put any abstraction on top of ElasticSearch's query DSL, so you can form any query that ElasticSearch allows:
http://www.elasticsearch.org/guide/reference/query-dsl/
So for your example, you'd just want to do something like:
Product.query(constant_score: {filter: {range: {price: {from: 10, to: 20}}}})
Hope that helps!
Mat
--
Christophe Moins
unread,
Nov 15, 2012, 6:11:30 AM
11/15/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to elasti...@googlegroups.com
perfect !
thank you
Reply all
Reply to author
Forward
0 new messages