I would like to be able to filter my orders on an amount range AND a specific user_id The expected result would be to get only the orders where the specified user did a bid on in a certain amount range.
For example there is an order with id 1. User 5 bid on it for an amount of 200. Now if I want to filter I set the user_id filter to 5 and set a range filter on amount for 150-250.
How do I configure sphinx to be able to filter in that way?
I have the following tables:
Order:
+-------------+-----------------------+
| Field | Type |
+-------------+-----------------------+
| id | mediumint(8) unsigned |
| title | varchar(100) |
| description | text |
+-------------+-----------------------+
Bid:
+--------------+-----------------------+
| Field | Type |
+--------------+-----------------------+
| id | mediumint(8) unsigned |
| order_id | mediumint(8) unsigned |
| user_id | mediumint(8) unsigned |
| amount | mediumint(9) |
+--------------+-----------------------+
I've tried the following in the sphinx configuration. But I cannot set the user_id as leading. The result is that I get all the orders where there are bids on in that amount range (from all the users), and I get all the orders where the user did a bid on.
sql_attr_multi = uint amount from query; SELECT order_id as id, amount FROM bids
sql_attr_multi = uint user_id from query; SELECT order_id as id, user_id FROM bids
Thanks