• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Exclude Forum from Search Index

nrep

Well-known member
#1
I've got a site that I'm considering converting with an archived section that I'd like to exclude from the search index, but currently can't. If I include this part of the site, I'll require 20GB of space in xf_search_index for no benefit (I did a test import to see the impact).

It would be very handy to have an "exclude node from search index" option.

For the time being, does anyone have a workaround?
 

Daniel Hood

Well-known member
#2
For the time being, does anyone have a workaround?
Open
/library/XenForo/Search/DataHandler/Thread.php

under:
PHP:
if ($threadModel->isRedirect($data) || !$threadModel->isVisible($data))
        {
            return;
        }
add

PHP:
if ($data['node_id'] == X) // replace X with the id of your node (example: 1)
{
 return;
}
Open
/library/XenForo/Search/DataHandler/Post.php

under:
PHP:
$metadata['node'] = $thread['node_id']; // line 52
add

PHP:
if ($thread['node_id'] == X) // replace X with the id of your node (example: 1)
{
 return;
}
 

nrep

Well-known member
#3
Thank you Daniel! Is that something that can be turned in to an addon, or would it always require file modification?
 

sinucello

Well-known member
#5
Good suggestion, I also need it. Should be available both for the default and advanced search.
A related topic are ignore functions. There are add-ons allowing users to exclude forums and topics from the "what`s new" views. Those should also be removed from the search results (if the user wants that).
 

AndyB

Well-known member
#6
I've got a site that I'm considering converting with an archived section that I'd like to exclude from the search index, but currently can't. If I include this part of the site, I'll require 20GB of space in xf_search_index for no benefit (I did a test import to see the impact).

It would be very handy to have an "exclude node from search index" option.

For the time being, does anyone have a workaround?
You should purchase the XenForo add-on Enhanced Search (aka ElasticSearch) for $45 dollars. That way you can easily include all your folders and searches will take just a fraction of a second.
 

nrep

Well-known member
#8
You should purchase the XenForo add-on Enhanced Search (aka ElasticSearch) for $45 dollars. That way you can easily include all your folders and searches will take just a fraction of a second.
Will this save on disk space, in comparison to using the XF search table? As that's my main reason for wanting to do this :).
 

Brogan

XenForo moderator
Staff member
#9
Indexed content needs to be saved somewhere - whether it's the database or elsewhere.

Essentially though, if your site is that large, standard MySQL search is going to struggle.
 

AndyB

Well-known member
#10
Will this save on disk space, in comparison to using the XF search table? As that's my main reason for wanting to do this :).
There are three main reasons to use Enhanced Search:

1) Search speed
2) The ability to use stemming searches
3) Time to rebuild the index

Disk space is a non-issue.
 
#12
You should purchase the XenForo add-on Enhanced Search (aka ElasticSearch) for $45 dollars. That way you can easily include all your folders and searches will take just a fraction of a second.
Will I be able to Exclude Forums from the Search Index with enhanced search?