Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Contextual Search -- Limiting search to specified knowledge bases or catalogs?

onthego
Giga Contributor

I've been working with contextual search in Fuji.   I feel like I'm missing something here in that there is no apparent configuration for what knowledge bases or catalogs the search can be limited toward.   It sniffs of "one size fits all" in a release where we now have multiple defined catalogs and knowledge bases.

My use case is having a wizard for the purpose of front ending a software how-to and/or request that allows the user to search for keywords in knowledge base articles and descriptions of catalog items associated with software requests (i.e. the software product catalog).   I need to limit the search toward software alone.

Has anyone else worked with limiting the search boundaries?

1 ACCEPTED SOLUTION

chrishenson
ServiceNow Employee
ServiceNow Employee

Hello Allan,



Just a quick intro, I'm one of the developers from UK Application Development which created Contextual Search.



Limiting the Service Catalog or Knowledge Base is configured in the Search Context.   I'd recommend creating a new search context which uses the Knowledge and Catalog searcher.   Once the context is created a set of Resource Configurations will be available to you.



Expand the catalog resource configuration you'll see the Catalog Name property.   Enter the name of the catalog you wish to limit the search to here.



Expanding the knowledge resource configuration a Condition property is made available to you.   You can restrict the Knowledge base you wish to search there using an encoded query E.g. kb_knowledge_base=ffcdf061ff2121009b20ffffffffffa4 for the 'out of box' HR catalog.



We're looking at providing a standard set of properties for search resources to make configuration more consistent.



Regards,



Chris Henson


View solution in original post

17 REPLIES 17

Hi @andy.dufresne  Please let me know if the Kb base sysid encoded query on context worked in Service Portal Knowledge search result or was in within records like incident?

We've been looking at contextual search for our HR Portal as well, where we want to add it to our HR service catalog items. We have multiple HR knowledge bases: one global KB and one KB for each country. Besides the HR knowledge bases we also have ITSM and SecOps knowledge bases on our instance. Hence we would like the contextual search to be able to query a subset of our knowledge bases.



Unfortunately out-of-the-box the contextual search seems to only be able to either query a single KB, or query all of them. But I haven't found a way to query a selection of them. chrishenson is there a workaround available for this that would allow us to query a subset of the knowledge bases? Or are further enhancements planned for an upcoming release that would allow us to do so? Appreciate your feedback on this.



Best regards,



Pascal Frencken


ServiceNow Platform Solution Architect


Philips Lighting


Hello Pascal,



I'll use the Incident Deflection Search Context as an example.   Looking at the Resource Configurations related list click the 'knowledge' entry.   You'll see there is a Condition property which takes an encoded query.



You could try adding the something like 'kb_knowledge_base=a7e8a78bff0221009b20ffffffffff17^ORkb_knowledge_base=dfc19531bf2021003f07e2c1ac0739ab' to query a selection of knowledge bases.   This example should search the base system IT and Knowledge knowledge bases.



You should be able to simply create the appropriate filter on the kb_knowledge list view and copy the query to the condition property of the appropriate context.



Hope that helps,



C


Thanks Christopher, I'll look into the encoded query.



Best regards,


Pascal Frencken


Hi Chris,

I also need to do this but no matter what screen I go to (whether an OOB or custom), I am unable to edit anything.   Is there something I can do to make these editable?

 

Uneditable OOB Knowledge resource configuration for Incident Deflection:

find_real_file.png

 

 

Custom search context showing I am unable to add a new Resource Configuration:

find_real_file.png


Susan Williams, Lexmark