Menu level filter in search results


#1

Matrix 5.4.3.1

Hi, is it possible to filter root levels from search results?
Eg, in the tree below, I only want child 1.1, child 1.2, child 2.1 and child 2.2 (filtering root, child 1 and child 2 from the results)
Root
Child 1
Child 1.1
Child 1.2
Child 2
Child 2.1
Child 2.2

Thanks.
Dave


(John gill) #2

Doesn’t appear so, as the Search Page asset doesn’t support anything like the Minimum Depth option of the Asset Listing Page.

You could hide the offending results with keyword trickery, but of course that will mess with your page sizes since if you’re trying to show 10 at a time the hidden ones will still count towards that 10. If you could tolerate that limitation, then you could just opt to not render anything based on lineage length.

%begin_asset_linking_lineage^count^gte:3%
<li> %asset_url% </li>
%end_asset%

(Bart Banda) #3

As John said, there is no depth control on Search Pages. You might be able to do something where the search page returns all levels, but it just returns a list of comma separated asset IDs. Feed that list into an asset listing to list those results and use the depth controls there?