Show Child Categories Of current category in fact for algolia Magento

I want to ask is there any way that I show only the child categories of the current category in Category fact. Currently when I add the category to the fact its show all the store categories. I checked the algolia helper function and also in instantsearch.js there I see the hierarchicalMenuParams which generate the Hierarchical tree of categories and also I changed the alwaysGetRootLevel option to false and added a new param showParentLevel with false value as per your documentation but not luck below is the code of hierarchicalMenuParams with customAttributeFacet

         var customAttributeFacet = {
         categories: function (facet, templates) {
         var hierarchical_levels = [];
        for (var l = 0; l < 10; l++)
             hierarchical_levels.push('categories.level' + l.toString());
      var hierarchicalMenuParams = {
     container: facet.wrapper.appendChild(document.createElement('div')),
     attributes: hierarchical_levels,
     separator: ' /// ',
     alwaysGetRootLevel: 'false',
     showParentLevel: 'false',
     limit: algoliaConfig.maxValuesPerFacet,
     templates: templates,
     sortBy: ['name:asc'],
     cssClasses: {
        list: 'hierarchical',
        root: 'facet hierarchical'

  hierarchicalMenuParams.templates.item = '' +
     '<div class="ais-hierearchical-link-wrapper">' +
     '<a class="{{}}" href="{{url}}">{{name}}' +
     '{{#isRefined}}<span class="cross-circle"></span>{{/isRefined}}' +
     '<span class="{{cssClasses.count}}">{{#helpers.formatNumber}}{{count}}{{/helpers.formatNumber}}</span></a>' +

  return algoliaBundle.instantsearch.widgets.hierarchicalMenu(hierarchicalMenuParams); }};

please guide me where I am doing wrong so that option is not working or is there any other way to achieve this

Hello @shaheer.ali,

thanks for pasting your code here. I can see you use 'false' as a string - with quotation marks. Remove the quotation marks around false and it should work.

alwaysGetRootLevel: false,
showParentLevel: false,

Hello @jan.petr

thanks for replying me here I tried both ways as a string and without the string but this is not working either way

below is the link of my instantsearch.js file
please have a look

Hello @shaheer.ali,

sorry for the late response.
You need to specify rootPath parameter to make it work.

And the path is passed in algoliaConfig variable, so what you can do is:

rootPath: algoliaConfig.request.path

Let me know if it works for you.