How to use Indices Algolia Page to Test Queries?

I have followed the docs on how to use OR in a query that uses facets:

When I execute the query, I get no results so I looked at the Indices page on the Search API Logs tab. I get the following Request and Response:

Request:

{
“params”: “hitsPerPage=3&page=0&query=king&removeStopWords=true&ignorePlurals=true&getRankingInfo=true&filters=((%22scope%3A2%22)%20OR%20(%22ownerUserId%3A351%22))&restrictSearchableAttributes=%5B%22title%22%2C%22source%22%2C%22tags%22%2C%22contentCategory%22%2C%22contentType%22%2C%22desc%22%5D”
}

Response:

{
“hits”: [
],
“nbHits”: 0,
“page”: 0,
“nbPages”: 0,
“hitsPerPage”: 3,
“exhaustiveNbHits”: true,
“query”: “king”,
“params”: “hitsPerPage=3&page=0&query=king&removeStopWords=true&ignorePlurals=true&getRankingInfo=true&filters=((%22scope%3A2%22)%20OR%20(%22ownerUserId%3A351%22))&restrictSearchableAttributes=%5B%22title%22%2C%22source%22%2C%22tags%22%2C%22contentCategory%22%2C%22contentType%22%2C%22desc%22%5D”,
“serverUsed”: “c8-usw-1.algolia.net”,
“indexUsed”: “dev_ABC”,
“parsedQuery”: “king”,
“timeoutCounts”: false,
“timeoutHits”: false,
“processingTimeMS”: 1
}

I am trying to figure out the best way to test out this query in the Algolia website. On the Indices page there is a Browse tab that allows for adding a Query Parameter that includes an Advanced Search dialog and Custom tab.

How can I use these online tools to test my query? I don’t see much documentation on how to use theses screens.

Thanks!

Hi Mark!

You can indeed use the Custom tab in the Advanced Search modal to pass custom search parameters along with your query.

This can help you test out your filters and see whether they properly yield results.

Is this what you needed?

Best,

Sarah.

I did what you showed, but it is not working for me.

From: Indices > Browse > Raw

Here is the request:

index.search("", {
 "hitsPerPage": 10,
 "page": 0,
 "analytics": false,
 "attributesToRetrieve": "*",
 "attributesToSnippet": "*:20",
 "getRankingInfo": true,
 "snippetEllipsisText": "…",
 "responseFields": "*",
 "enableABTest": false,
 "filters": "\"scope:2\" OR \"ownerUserId:351\"",
 "facets": "*,contentCategory,contentType,ownerUserId,scope,source,tags,title"
});

And the response:

{
  "hits": [],
  "nbHits": 0,
  "page": 0,
  "nbPages": 0,
  "hitsPerPage": 10,
  "facets": {},
  "exhaustiveFacetsCount": true,
  "exhaustiveNbHits": true,
  "query": "",
  "params": "query=&hitsPerPage=10&page=0&analytics=false&attributesToRetrieve=*&highlightPreTag=%3Cais-highlight-0000000000%3E&highlightPostTag=%3C%2Fais-highlight-0000000000%3E&attributesToSnippet=*%3A20&getRankingInfo=true&snippetEllipsisText=%E2%80%A6&responseFields=*&enableABTest=false&filters=%22scope%3A2%22%20OR%20%22ownerUserId%3A351%22&facets=*%2CcontentCategory%2CcontentType%2CownerUserId%2Cscope%2Csource%2Ctags%2Ctitle&tagFilters=",
  "index": "XXXXXX",
  "serverUsed": "c8-usw-1.algolia.net",
  "indexUsed": "XXXXXX",
  "parsedQuery": "",
  "timeoutCounts": false,
  "timeoutHits": false,
  "processingTimeMS": 1
}

There are over 300 entries that are scope:2

Ideas?

This original query you sent doesn’t seem to be the same one as on your last post. If I decode the original, I see that the plain version is more this:

{
  "params": {
    "hitsPerPage": 3,
    "page": 0,
    "query": "king",
    "removeStopWords": "true",
    "ignorePlurals": "true",
    "getRankingInfo": "true",
    "filters": "((\"scope:2\") OR (\"ownerUserId:351\"))",
    "restrictSearchableAttributes": [
      "title",
      "source",
      "tags",
      "contentCategory",
      "contentType",
      "desc"
    ]
  }
}

Could you clarify if that gives the no results as expected?

Thanks!

PS. We definitely see the need for a tool to decode these parameters, but it’s not finished yet. I4ve published a WIP version here: https://haroen.me/algolia-tools/#request-explorer