Not all values appearing in search facets for translated articles

Aidan
Tera Guru

I'm customising the search facets for knowledge and have successfully added in a couple of custom fields, this is working fine, with one exception.  Any foreign language article values are not showing up in the search fact, even though the translated article is returned in the search results, and the search multiple languages property is set.

So for example, if I have the following articles;

Article titleLanguageApplicable CountryCategory
This is a sample English articleenUK, USA, AustraliaEnglish Category
This is a sample French articlefrFrance, CanadaFrench Category

 

If I search for 'sample' I get both articles returned, but the search facet will only show 'UK, USA,Australia' as options in the country, and English Category as a category.  I would expect to see 'UK, USA, Australia, France, Canada'.

Clearly the search source is not seeing the same results as the actual search.

 

1 ACCEPTED SOLUTION

Aidan
Tera Guru

The answer lies in the call to "KBPortalServiceImpl().getAllFacets" in the facet script.  The second parameter holds the language ('en' by default), so changing it to 'en,fr' brings back all the results as expected.

View solution in original post

4 REPLIES 4

Aidan
Tera Guru

The answer lies in the call to "KBPortalServiceImpl().getAllFacets" in the facet script.  The second parameter holds the language ('en' by default), so changing it to 'en,fr' brings back all the results as expected.

Hi Aidan, thanks for posting the solution to the issue you had.I have made the same change in my code but unfortunately still can't get it working. I am trying to do the same thing as you and add the language as an option in the Knowledge search source. I have made changes to the Facet generation script that I think are required but I am obviously missing something!

Would you be able to post the code you used for this so I can try and figure out where I am going wrong please?

Thanks

Steve Wiseman
Tera Guru

Hi Aidan, just to let you know I have just figured this out and it was not the Facet generation script causing my problem, it was the Data fetch script. I just needed to amend the code where it sets up the request variable (line 24) from: 

   language : "",

to 

   language : facets.language,

Thanks again for posting the solution to the issue you were having as this has saved me some time!

Steve

Hello Steve,

can you please help me on this, we have enabled multi language support in portal and i want to modify the search source to return knowledge articles irrespective of language selected in the portal

if my language setting is french i should be able to view the knowledge articles in english as well.

i posted the question in community as well but no luck so far( https://community.servicenow.com/community?id=community_question&sys_id=ba86b9be1be2d414305fea89bd4b...

any suggestions will be very helpful to me

 

Thanks and Regards,

Prerana