0

I have set up a google custom search engine for my site and it works really well. I have also set up refinements for different categories in the site. E.g. Cups, Saucers, Plates

When I do a search using the api or search box, for "China Cups" google returns good results, along with refinement labels for All, Cups, Saucers and Plates.

However, clicking on Saucers or Plates refinement tab returns zero results. How can I prevent google from returning refinement tabs that will yield zero results for that search?

PS: Even if I adjust max top refinements to 2, google will return "All, Cups, Saucers" as refinements. Saucer refinement will still yield zero results.

hitwill
  • 575
  • 1
  • 9
  • 25
  • Should I just use the api to do a query to the returned refinements, confirming the count of results returned, then displaying the possible refinements to the user? – hitwill Jan 05 '16 at 00:33

1 Answers1

0

Yes the refinements simply display possible filters, without checking the content. In contrast, facets include the value count, which can be zero if that would be helpful to the users.

The Google Custom Search is giving you filters, so you would have to do your own pre-flight counting.

avirr
  • 658
  • 5
  • 9
  • Thanks for the response. How can I get the facets to show the count? Here is a link to the call I am making - mine doesn't seem to be showing the facet counts: https://www.googleapis.com/customsearch/v1?q=bendix&cx=003918577885108408305%3Abgcetecsm_q&fields=context%2Citems%2Ckind%2Cpromotions%2Cqueries%2CsearchInformation%2Cspelling%2Curl&key=AIzaSyDwh5EhvrqQ-CECBrFc_xFl3vb-UXaWPQA – hitwill Jan 07 '16 at 00:02
  • This is not an out-of-the-box feature, so as you say above, you should get the full results and then confirm the counts. If you have more than a thousand items you should do that. – avirr Jan 11 '16 at 22:14