Faceted searches through a Matrix REST Resource

Hi all

 

I *know* I've come up against this before, I *think* I remember what the issue was, but I *don't* remember how to fix it.

 

Issue is I'm accessing Funnelback collections via a REST resource in Matrix, params get passed through, REST resource talks to Funnelback servers, responds, display results, etc.  I have set up some faceted searches, all good.  The params being passed through all look correct.   So far so good.

 

However, when I click on a faceted search it doesn't *do* the faceted search.  It just repeats the same search, with no change to the results or the layout of the facets.  The URL has the faceted params on it, specifically:

&f.Refine search|H=Webpage

we are trying to refine the search on all records where the metadata class 'H' is 'Webpage'.  I've narrowed it down to the REST resource because if I look at the results outside the REST resource (i.e. direct from FB admin view) then the results and facets and everything works fine.

 

I'm pretty sure when I investigated this before the issue was something like the REST resource is escaping the pipe character or is lost in some other way during transmission, so when Funnelback gets the query it's not recognising it as a faceted search.

 

The fix was....well, I don't remember now.  Anyone seen this, know what I'm talking about?

Hi Tim -

 

It sounds like you're needing to rewrite some of the URL prefixes dynamically created by Funnelback when rendering pagination, contextual navigation, faceted navigation, and the like.

 

Take a look at:

https://docs.funnelback.com/ui_modern_search_link_collection_cfg.html

https://docs.funnelback.com/ui_modern_click_link_collection_cfg.html

 

Looking at the Funnelback endpoint directly, you should be able to see those configuration changes take effect immediately on the corresponding elements of the Funnelback data model.

Thanks for quick response Gordon, but I'm not sure that's it.  I'm pretty familiar with those rewrites and symptoms, etc.  E.g. if that was the issue then none of the navigation or contextual or click-tracking links would work, but they all are.

 

After a little more digging it looks like the REST resource is replacing dots and spaces in the URL (I thought it may have been the pipe, turns out it's not).

 

The following arg translation occurs:

f.Refine search|H

gets changed to

f_Refine_search|H

This seems intrinsic to the REST resource.  I did a little testing with hook_pre_process and found I could force the facet in from that modified query arg, but then it was missing the ': all' link at the start of the selected facet.

 

Eventually found out that if I changed the facet name so it doesn't have any spaces then everything just magically works, e.g. I changed 'Refine search' facet label to 'Format', so now the args passed are:

f.Format|H=

and that seems to get to Funnelback servers exactly as intended.  So that's solved our problem - we just can't have facet labels with spaces in them.

 

Still not sure whether this is a Matrix bug or Funnelback - I'm leaning towards Matrix as I recall being told we would need a patch to fix the Matrix REST resource for this to work, but that was a different instance on an older version.