Skip Navigation
Knowledge Advanced Search API and facets
Answer ID 10121   |   Last Review Date 10/13/2021

How do I use and interpret facets with the search REST API?


Oracle B2C Service Knowledge Advanced Search REST API


The search REST API /question endpoint returns a results list along with facets that are associated with that list, and each question returns results with only the next level of facets and not the sub-facets of those.  

  • The facets can only be selected one at a time in a tree, so 1 product, 1 category, 1 collection, 1 doc type.
  • The next level of facets returned will only be for the specified facets in the question.
  • There is not sub-facet information for a Collection filter.
  • Facets will be returned that are relevant to the content returned, so 1 search may return 5 children while another only returns 2.  Or when I use CMS-PRODUCT as the filter, i get 7 different PRODUCT facets, and 6 collections and  none of them show me the children because none of them are selected
  • In some cases you might have to drill down 2-3 levels of a facet to get to the leaf children, where the actual assignment are, because the parents are inherited, rather than assigned.
  • In the case of faceting a multi-level product tree, the entire tree needs to be included in the request
    • Product C (RN_PRODUCT_4) has 2 levels of children -- child product L (RN_PRODUCT_7) and a child of L -- product Y (RN_PRODUCT_19)
    • The search REST API request URL would need include facet=CMS-PRODUCT.RN_PRODUCT_4.RN_PRODUCT_7.RN_PRODUCT_19
    • When a facet from the product tree is selected, the search results include articles from the parent facets
    • When a facet from the category tree is selected, the search results include articles from the child facets only, the parent facets are not applied.