title: Creating a workable Redis store with several filters
body: <p>I am working on a system to display information about real estate. It runs in angular with the data stored as a json file on the server, which is updated once a day.</p>
  
  <p>I have filters on number of bedrooms, bathrooms, price and a free text field for the address. It's all very snappy, but the problem is the load time of the app. This is why I am looking at Redis. Trouble is, I just can't get my head round how to get data with several different filters running.</p>
  
  <p>Let's say I have some data like this: (missing off lots of fields for simplicity)</p>
  
  <pre><code>id  beds  price
  0   3     270000
  1   2     130000
  2   4     420000
  </code></pre>
  
  <p>etc...</p>
  
  <p>I am thinking I could set up three sets, one to hold the whole dataset, one to create an index on bedrooms and another for price:</p>
  
  <pre><code>beds  id
  2     1
  3     0
  4     2
  </code></pre>
  
  <p>and the same for price:</p>
  
  <pre><code>price   id
  130000  1
  270000  0    
  420000  2
  </code></pre>
  
  <p>Then I was thinking I could use SINTER to return the overlapping sets.
  Let's say I looking for a house with more than 2 bedrooms that is less than 300000. </p>
  
  <p>From the bedrooms set I get IDs 0,2 for beds > 2. </p>
  
  <p>From the prices set I get IDs 0,1 for price &lt; 300000</p>
  
  <p>So the common id is 0, which I would then lookup in the main dataset.</p>
  
  <p>It all sounds good in theory, but being a Redis newbie, I have no clue how to go about achieving it!</p>
  
  <p>Any advice would be gratefully received!</p>