Note that there are some explanatory texts on larger screens.

plurals
  1. POSphinx: Filtering MVA on multiple fields
    text
    copied!<p>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. </p> <p>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.</p> <p>How do I configure sphinx to be able to filter in that way? </p> <p>I have the following tables:</p> <p>Order:</p> <pre><code>+-------------+-----------------------+ | Field | Type | +-------------+-----------------------+ | id | mediumint(8) unsigned | | title | varchar(100) | | description | text | +-------------+-----------------------+ </code></pre> <p>Bid:</p> <pre><code>+--------------+-----------------------+ | Field | Type | +--------------+-----------------------+ | id | mediumint(8) unsigned | | order_id | mediumint(8) unsigned | | user_id | mediumint(8) unsigned | | amount | mediumint(9) | +--------------+-----------------------+ </code></pre> <p>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.</p> <pre><code>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 </code></pre> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload