# Hiding XX results found using AI - enable toggle by default

**URL:** https://meta.discourse.org/t/hiding-xx-results-found-using-ai-enable-toggle-by-default/385784
**Category:** Feature
**Tags:** ai, ai-search
**Created:** [October 16, 2025, 2:59am UTC](https://meta.discourse.org/t/hiding-xx-results-found-using-ai-enable-toggle-by-default/385784 "2025-10-16T02:59:45Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [October 16, 2025, 2:59am UTC](https://meta.discourse.org/t/hiding-xx-results-found-using-ai-enable-toggle-by-default/385784/1 "2025-10-16T02:59:45Z")

</div>

I’m experimenting with using AI on our discourse forum and so far its pretty good (great work guys), it’s really taking into context user intent and provides very relevant results.

The problem is I see is that the results are hidden by default

 ![image](https://global.discourse-cdn.com/meta/original/4X/2/7/1/271a27b2dbadcff2d4b25f34f32c41a0f5e23127.png)

I cant find any settings to enable the toggle by default, how does the admin do this? The real power is to enable this feature by default and move away from semantic search which can be a hit or miss.

Funnily I tried to search this this forum using AI and couldn’t get any relevant answers.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [October 16, 2025, 4:30am UTC](https://meta.discourse.org/t/hiding-xx-results-found-using-ai-enable-toggle-by-default/385784/2 "2025-10-16T04:30:37Z")

</div>

Well, AI still found it in the Related Topics section 😉:

> [@Discourse AI - AI search](https://meta.discourse.org/t/discourse-ai-ai-search/282420):
>
> bookmark This guide explains how to enable and configure the AI search feature, which is part of the [Discourse AI](https://meta.discourse.org/t/discourse-ai/259214) plugin. person_raising_hand Required user level: Administrator Similar to [Related topics](https://meta.discourse.org/t/discourse-ai-related-topics/281807), AI search helps you find the most relevant topics using semantic textual similarity that are beyond an exact keyword match used by traditional search. This results in the discovery of topics that are non-exact matches but still relevant to the initial search. If you can’t find what you’r…

---

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [October 16, 2025, 5:41am UTC](https://meta.discourse.org/t/hiding-xx-results-found-using-ai-enable-toggle-by-default/385784/3 "2025-10-16T05:41:38Z")

</div>

Yes I’ve seen that page but I don’t see anything there that talks about how to enable the AI search results by default for everyone. Am I missing something here?

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [October 16, 2025, 6:37am UTC](https://meta.discourse.org/t/hiding-xx-results-found-using-ai-enable-toggle-by-default/385784/4 "2025-10-16T06:37:37Z")

</div>

Perhaps I misunderstood you 🙂. I thought you meant ‘enable the feature’ instead of ‘enable the toggle switch’. If you’re referring to the toggle, I don’t think there’s a way to do so.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [October 16, 2025, 1:25pm UTC](https://meta.discourse.org/t/hiding-xx-results-found-using-ai-enable-toggle-by-default/385784/5 "2025-10-16T13:25:18Z")

</div>

We _just_ made it toggle by default when the full page search has zero results, and will make it auto-append AI results on the quick header search has zero or few results next.

There is no setting to _always_ toggle it automatically on the full page search, as that would case [https://medium.com/@stephenjayakar/frontend-developers-stop-moving-things-that-im-about-to-click-on-5827bc0409b3](https://medium.com/@stephenjayakar/frontend-developers-stop-moving-things-that-im-about-to-click-on-5827bc0409b3)

---

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [October 16, 2025, 8:01pm UTC](https://meta.discourse.org/t/hiding-xx-results-found-using-ai-enable-toggle-by-default/385784/6 "2025-10-16T20:01:21Z")

</div>

That’s a great start. It would be nice to have an option to prioritize which results we want to show as the first choice (extension of the logic that was just implemented). AI or native semantic search. In my case the AI produces far more relevant results when searching.

The thought here is that the token are already consumed to run the AI search so why not show the results if they are more appropriate. Many users are still wary of AI so they don’t toggle the switch but at the same time end up with misleading search results (semantic) and they don’t realize it. Let the admins decide what’s best for their community defaults.

---

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [October 17, 2025, 4:52am UTC](https://meta.discourse.org/t/hiding-xx-results-found-using-ai-enable-toggle-by-default/385784/7 "2025-10-17T04:52:49Z")

</div>

As a temporary solution if someone needs to enable the toggle button by default, you can add this script to your theme (I’ve put it under \<body\>) which basically looks for a change in the AI search results and then toggles the AI results to enabled. This isn’t the cleanest code, maybe @awesomerobot has a more elegant way to do this.

```plaintext
<script type="text/javascript">
    // THIS SCRIPT IS TO ENABLE THE TOGGLE TO INCLUDE SEARCH RESULTS FROM AI AFTER THE SEARCH IS COMPLETE - DELETE ONCE THERE IS A NATIVE OPTION TO ENABLE THIS BY DEFAULT
    console.log('Script loaded. Continually looking for .semantic-search__searching and managing observer.');

    let searchObserver = null; // Variable to hold the observer instance

    function observeSearchContainer() {
      const searchStatusContainer = document.querySelector('.semantic-search__searching');

      if (searchStatusContainer) {
        // If the container is found
        if (!searchObserver) {
            // If an observer is not already running, start one
            console.log('.semantic-search__searching found. Starting observation.');

            searchObserver = new MutationObserver(function(mutations) {
              //console.log('Mutation detected in .semantic-search__searching:', mutations);
              mutations.forEach(function(mutation) {
                // Check for relevant mutations within the observed container
                if (mutation.type === 'characterData') {
                  //console.log('Relevant mutation type detected. Attempting to trigger toggle button functionality. ' + mutation.type);
                  const currentToggleButton = document.querySelector('button.d-toggle-switch __checkbox.semantic-search__ results-toggle');
                  if (currentToggleButton) {
                      const isCurrentlyEnabled = currentToggleButton.getAttribute('aria-checked') === 'true';
                      if (!isCurrentlyEnabled) { // If the toggle is NOT currently enabled
                        // Trigger a click event to activate associated functionality
                        currentToggleButton.click();
                        console.log('Toggle button click event triggered.');
                      } else {
                        console.log('Toggle button already enabled.');
                      }
                  } else {
                    // This case might happen if the toggle button is removed while the container is still present
                    console.log('Toggle button not found when trying to trigger functionality.');
                  }
                }
              });
            });

            const config = { childList: true, subtree: true, characterData: true, attributes: true };
            searchObserver.observe(searchStatusContainer, config);
            console.log('MutationObserver started on .semantic-search__searching.');
        } else {
            // Container found, and observer is already running for it
            //console.log('.semantic-search__searching found, observer already active.');
        }
      } else {
        // If the container is NOT found
        if (searchObserver) {
            // If an observer was previously running, it means the container was removed
            console.log('.semantic-search__searching removed. Disconnecting observer.');
            searchObserver.disconnect(); // Stop observing
            searchObserver = null; // Reset the observer variable
        } else {
            // Container not found, and no observer is active (correct state)
            //console.log('.semantic-search__searching not found yet.');
        }
      }
    }

    // Use an interval to periodically check for the existence of the container
    const containerCheckInterval = setInterval(observeSearchContainer, 500); // Check every 500 milliseconds
</script>

```

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [October 25, 2025, 6:59pm UTC](https://meta.discourse.org/t/hiding-xx-results-found-using-ai-enable-toggle-by-default/385784/8 "2025-10-25T18:59:57Z")

</div>

I moved this to #Contribute > Feature since it seems to be an open ended conversation about how to improve this feature.
