How to use the coveo-search-ui.Initialization.registerAutoCreateComponent function in coveo-search-ui

To help you get started, we’ve selected a few coveo-search-ui examples, based on popular ways it is used in public projects.

github coveo / samples / jsui-custom-components / itemgrouping / src / ui / ItemGrouping.ts View on Github external
args.queryBuilder.advancedExpression.add("[[" + this.options.fieldToGroup + "] " + args.queryBuilder.expression.build() + "]")
      this.addKeywordsToQRE(args);
      args.queryBuilder.expression.remove(args.queryBuilder.expression.build());
    }
  }

  private addKeywordsToQRE(args: IBuildingQueryEventArgs){
    const words = args.queryBuilder.expression.build().split(" ");
    words.forEach(element => {
      args.queryBuilder.advancedExpression.add("$qre(expression:'" + this.options.fieldForRanking + "=" + element + "', modifier:'15')")
    });
  }

}

Initialization.registerAutoCreateComponent(ItemGrouping);