---
schema_version: "1"
id: b4c1f16a0f85c72f14e075e824fd4e0bb3ec95238d67f8d4448ac75c482435af
title: Use More Case Keywords to Find Articles
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/knowledge_admin_tricks_examples_casesearch.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.knowledge_admin_tricks_examples_casesearch.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: b0edef0c1172672ac3a7e54962405b063fdc10661d89c4745c8d11012b26475e
description: When searching knowledge articles from a case, by default, only the case title is used in the search. Often, you want to use information from the case for more accurate search results, or create a custom search button.
products:
  - Service Cloud
release: "264"
---
# Use More Case Keywords to Find Articles

When searching knowledge articles from a case, by default, only the case title is used in the search. Often, you want to use information from the case for more accurate search results, or create a custom search button.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in Salesforce Classic and Lightning Experience. <a href="https://help.salesforce.com/s/articleView?id=service.service_editions_reference.htm&amp;language=en_US" target="_blank">View supported editions</a>.</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d127322e58">User
              Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d127322e58 ">To create or change custom buttons or links and create a
              Visualforce page:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d127322e58 ">
              <p style="margin-bottom:0;">Customize Application</p>
            </td>

          </tr>
        </tbody>
      </table>

Luckily, Salesforce Knowledge search pages accept other parameters:

- id=<case id>: The ID of the current case.
- search=<keywords>: The keywords to be searched.
- articleType\_<article type dev name>=on: multiple parameters possible, article types to select (if no article type is selected, then all article types are selected)
- ct\_<data category group internal name>=<data category internal name>: multiple parameters possible, filter pre-selection

To take advantage of those parameters, add a custom button to the case detail page containing a few lines of javascript that extract keywords from the case and hide the default article search button.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support-264-0-0-production-enus/dd14551c-a772-4db6-9a1d-d84df8df2980/images/icon_note.png)

Note You can also create a custom article widget with support:caseArticle. 

1. From the object management settings for cases, go to Buttons, Links, and Actions.
2. Click **New Button or Link**.
3. Enter a unique Label, Name, and Description.
4. Select **Detail Page Button** for Display Type.
5. Select **Execute JavaScript** in the Behavior dropdown.
6. Select **OnClick JaveScript** in the Content Source dropdown.
7. Enter code for extracting case data and setting up parameters for the article search page.
    
    For example:
    
    ```javascript
    // article search page URL
    var url = '/knowledge/knowledgeHome.apexp';
    
    // ID of the current case
    url += '?id={!Case.Id}';
    
    // use the case subject as the search keywords
    url += '&search={!Case.Subject}';
    
    // read case attributes
    var caseType = '{!Case.Type}';
    var caseProduct = '{!Case.Product__c}';
    
    // if the case is of a certain type, select only 2 of the article types available
    // in other cases, we keep the default behavior (all article types selected)
    
    if (caseType=='Problem' || caseType=='Question') {
       url += '&articleType_FAQ_kav=on';
       url += '&articleType_How_To_kav=on';
    }
    
    // preselect a data category for search results based on the category
    
    var product = '';
    if (caseProduct=='Home')
       product = 'Home';
    if (caseProduct=='SMB')
       product = 'Small_and_Medium_Business';
    if (caseProduct=='Large enterprise')
       product = 'Large_Enterprise';
    
    if (product.length>0)
       url += '&ct_Products2=' + product;
    
    // once the logic is executed, we go to the article search page
    window.location = url;
    ```
8. Click **Save**.
9. From the object management settings for cases, go to Page Layouts.
10. Click **Edit** next to Case Layout.
11. Drag your custom button for article search into the case layout.
12. Click **Save**.
13. Create a Visualforce page named CaseDetailsWithoutStandardKBSearchButton with the following code:
    
    ```markup
    <apex:page standardController="Case">
        <style type="text/css">
            div.knowledgeBlock input {display: none}
        </style>
        <apex:detail/>
    </apex:page>
    ```
14. Back in the Buttons, Links, and Actions area for cases, click **Edit** next to View.
15. Select **Visualforce Page** in Override with.
16. Select **CaseDetailsWithoutStandardKBSearchButton** from the dropdown.
17. Click **Save**.

#### See Also

- [Improve the Knowledge Article Search Experience](https://help.salesforce.com/s/articleView?id=service.knowledge_search_improve.htm&release=264.0.0&type=5 "To improve the Salesforce knowledge article search experience, enable search highlights, snippets, synonyms, promoted terms, topics, and case keywords.")
- [Salesforce Knowledge Help and Resources](https://help.salesforce.com/s/articleView?id=service.knowledge_map.htm&release=264.0.0&type=5 "Find the information you need about Salesforce Knowledge. Explore help documentation, developer documentation, and Trailhead modules.")
- [Salesforce Knowledge Guide (Classic)](https://resources.docs.salesforce.com/latest/latest/en-us/sfdc/pdf/salesforce_knowledge_implementation_guide.pdf)