How to prevent attachments from displaying in search results?

MG Casey
Mega Sage

Hi,

I need a way to prevent a knowledge article's attachments from displaying in the search results. Example:

find_real_file.png

With the article's 3 attachments, the search results screen is way enlarged and a bit ugly.

I've messed around with each of the kb_knowledge table's dictionary attributes: entry:email_client=true,text_index_filter_junk=false,attachment_index=true,synch_attachments=false,text_index_attachment_displayed=false

But none of them seem to be the trigger for this.

Any ideas?

8 REPLIES 8

Modifying the OOB macro condition would work in this case


JamesD
Tera Contributor

I know this is an old post, but we were recently experiencing the same problem of knowledge attachments displaying in the search results.



What may have been missing is regenerating the index after turning off the attributes.



I had set the dictionary attributes on the kb_knowledge table to false:


attachment_index=false,text_index_attachment_displayed=false




Some searches would successfully not display the attachments, but if we happened on search terms that specifically matched the attachment in the article, the attachments would still show.



It wasn't until I went into System Definition -> Text Indexes and opened the index for kb_knowledge. In there is the link to Regenerate Text Index. (Inside the dictionary for kb_knowledge there is also a link to Generate Text Index, this may have the same function but I had the Index open and I know that worked).



Our KB is relatively small so it only took about a minute to index. Anyone with a large KB may want to wait until after-hours to minimize any impacts to performance. In any event, I came back after a few minutes to test and now attachments don't seem to be returning in the search results no matter what terms are used.



Don't know if that helps at this point, but maybe someone else can use the info.


I am also having the same requirement. I tried this above approach and set the value in attributes and regenerate the text index. It is working.


Still need to confirm whether this approach will have any other impact.



Thanks in advance.


asifnoor
Kilo Patron

I know this is a very old post, and with latest releases, this is possible in various ways.

 

1. In dictionary->kb_knowledge-> attributes

 

add this attribute text_index_attachment_displayed=false and reindex, then attachments will not be shown in search results.

 

2. If you want to restrict this to few attachments and not all, then you can do the following changes 


- UI macro named "kb_search_results_v3" which renders the search results.
- In this UI macro "kb_search_results_v3", we are calling another UI macro named "kb_attachment_list_entry". This is core UI macro.
- You can make changes in this macro as per your requirement.