Cannot filter by custom fields, nor get custom knowledge article fields in the search response

ZoranG
Tera Contributor

I’ve encountered a roadblock with knowledge search, both on the portal and the API (sn_km_api/knowledge/articles). I would greatly appreciate any help or advice.

 

Summary of the problem:  How can I configure KBSearch to use a custom table (u_kb_template_*) that extends kb_knowledge instead of kb_knowledge?

 

Steps I’ve taken:

  • Created a custom article template that introduces several new fields to the knowledge articles. These fields are automatically prefixed with u_kb_* as expected.
  • Configured the form layout and list view, allowing me to enter and edit articles as defined in the template.
  • Configured the list view and can filter by any of the fields. This works great.
  • Configured a portal for the KB and verified that the search on the portal (and through the API) includes the custom fields and returns articles that match the entered text in the custom fields too.

The problem (applicable to both portal search and API):

  • I cannot configure KBSearch to use the table with the custom fields (u_kb_template_*); it only searches kb_knowledge.
  • I can only ask for fields that are on kb_knowledge (e.g., author), but not any of the custom fields (u_kb_*). (e.g. the fields parameter will return core fields, but not custom ones)
  • I cannot create filters based on any of the custom article fields.

However:

  • The search does return articles that match the entered text when found in the custom fields.
  • The article snippet includes text from the custom fields, but the format is not as desired.

Questions:

  1. Has anyone managed to create filters for custom fields and have custom fields included in the search response (in the fields block of each item)? How?
  2. How can I modify the format of the snippet returned with each result?
6 REPLIES 6

ZoranG
Tera Contributor

Confirming: I used out of the box article template feature to create a new module. I understand that created a new table that extends kb_knowledge. 

 

ZoranG
Tera Contributor

I switched to the Data Table from Instance Definition widget to use my extended table (u_kb_template_*). This allows keywords search and filters for all fields. I would have preferred to use it as knowledge...

 

If anyone knows how to make kb-field-facet and kb-query-facet (and the search, ofc) also include fields from the template (i.e. extended table) and not just kb_knowledge, that would be ideal.