0

I'm using Algolia-helper-swift [0.1] with Algolia-client-swift [3.7] since im using xcode 7.3.1 and swift 2.0+ and my json structure snippet is as follows

 "-KTKNoEhrdaBShtXJGM8" : {
"Book_name" : "Hello World",
"Book_price" : 7273,
"uploaded_by" : "John" }

Trial 1

{
  "params": "facetFilters=[]&filters=Book_price%3E0%20AND%20uploaded_by:John&hitsPerPage=8&page=0&query=&restrictSearchableAttributes=[%22Book_name%22]"
}

Trial 2

{
  "params": "facetFilters=[]&filters=Book_price%3E0%20AND%20uploaded_by:%22John%22&hitsPerPage=8&page=0&query=&restrictSearchableAttributes=[%22Book_name%22]"
}

Trial 3

{
  "params": "facetFilters=[]&filters=Book_price%3E0&hitsPerPage=8&page=1&query=&restrictSearchableAttributes=[%22Book_name%22]"
}

Trial 4

{
      "params": "facetFilters=[]&filters=uploaded_by:%22John%22&hitsPerPage=8&page=0&query=&restrictSearchableAttributes=[%22Book_name%22]"
    }

The Trial 1,2 & 4 don't work returns me 0 results/hits the third however works but its a numerical logic. Please if someone could help me with this it would be great.

Lobo
  • 146
  • 9
  • a work around was to restrict searching to book name and uploaded by and then query "uploaded by john" + querystring – Lobo Oct 20 '16 at 20:07

1 Answers1

0

This is what you need to do, to get filtering working by getting attribute uploaded_by faceted. This is very helpful for analytics as well as knowing how are sharing same tags or attributes names.

  1. Go to your algolia dashboard
  2. click on indices
  3. click on display
  4. under facets, add attributes that you would like to facet save and wait until algolia processes as it will depend on the amount of data you have.
  5. use Searcher.query.filters = [""], for me it was ["uploaded_by:\"John\""]
Lobo
  • 146
  • 9