Skip to main content
Skip table of contents

Limiting Discoverable Items

With Discovery Server, you are able to filter which search results are viewable by all users and, conversely, which search results should never be displayed to your users.


Updating the Web.config file

  1. Edit Discovery Server’s Web.config file by updating the SearchableFieldEnabled key. Set the value=”true”

  2. Save

  3. Restart the Discovery Search site in IIS

Adding the searchable script

To ensure an item will appear in Discovery Server search results, the item must be tagged as 'searchable’.

  1. Open Visualizer

  2. Copy the following script into the Dev Tools in Visualizer

    CODE
    POST /shiny/_update_by_query?conflicts=proceed
    {
      "script": {
        "source": "ctx._source.searchable = params.searchable",
        "lang": "painless",
        "params": {
          "searchable": true
        }
      },
      "query": {
        "match": {
          "_id": "cbbe97d86d5f5768093cfc4615c1e0e643ba4e47"
        }
      }
    }
  3. Enter the ID of the item you want to tag in the id field (line 12)

  4. Items with the searchable field set to "true" (line 7), will appear in search results.

  5. Items with the searchable field set to "false" (line 7), will NOT appear in search results and will return the following message:

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.