1. 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

Discussion in 'XenForo Suggestions' started by nrep, May 13, 2014.

  1. nrep

    nrep Well-Known Member

    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?
     
    Mijo, BamaStangGuy, DivokyMuz and 2 others like this.
  2. Daniel Hood

    Daniel Hood Well-Known Member

    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 likes this.
  3. nrep

    nrep Well-Known Member

    Thank you Daniel! Is that something that can be turned in to an addon, or would it always require file modification?
     
  4. Daniel Hood

    Daniel Hood Well-Known Member

    It could be made an add on with some work.
     
    nrep likes this.
  5. sinucello

    sinucello Well-Known Member

    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).
     
  6. AndyB

    AndyB Well-Known Member

    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.
     
  7. Jeremy

    Jeremy XenForo Moderator Staff Member

    Enhanced Search is $50.
     
  8. nrep

    nrep Well-Known Member

    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 :).
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    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.
     
  10. AndyB

    AndyB Well-Known Member

    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.
     
  11. nrep

    nrep Well-Known Member

    Thanks for the additional info :).
     
  12. Main Company

    Main Company Active Member

    Will I be able to Exclude Forums from the Search Index with enhanced search?
     
  13. AndyB

    AndyB Well-Known Member

    Yes.
     
  14. Main Company

    Main Company Active Member

    Then I guess I'm the next customer :)
     
  15. Mike

    Mike XenForo Developer Staff Member

    Umm... no.

    Not surewhy @AndyB said that. It's not a feature - Enhanced Search just a drop in replacement for the actual search component itself.
     
  16. AndyB

    AndyB Well-Known Member

    Good catch, Mike.

    I was thinking of the Option (Include threads from this forum when users click "New Posts").
     
  17. Main Company

    Main Company Active Member

    Any existing options that will allow me to Exclude Forums from the Search Index???
     
  18. Mike

    Mike XenForo Developer Staff Member

    No. It would require an add-on.
     
  19. Daniel Hood

    Daniel Hood Well-Known Member

  20. BamaStangGuy

    BamaStangGuy Well-Known Member

    I would like to see this. It would reduce our Elastic Search size down greatly from forums that are archived and no longer viewable to anyone.
     
    sinucello and Daniel Hood like this.

Share This Page