WordPress.org

Ready to get started?Download WordPress

Forums

Search Engine
[resolved] Why is it only searching one website? (5 posts)

  1. Glazed Donuts
    Member
    Posted 2 years ago #

    Is there any way for this plugin to be able to search other websites we specify. It seems, depending on what's in the "Default Site for Search" box, then that's what the search engine will search. We have other websites that we would like the search engine to search, and I've not been able to figure out how to allow the plugin to do this. We've specified the other websites in the Index Template's section.

    For example, this is what's going on.

    In the Index Templates section, we have 5 websites we would like the search engine to search:
    1. http://www.websiteA.com
    2. http://www.websiteB.com
    3. http://www.websiteC.com
    4. http://www.websiteD.com
    5. http://www.websiteE.com

    We made sure in the 'Whitelisted URLs' section that the 5 websites were there, all separated by commas.

    In the 'Default Site for Search' section, we have 'http://www.websiteB.com' selected.

    When we try to do a search, it only brings back results from http://www.websiteB.com only and not the other websites.

    Also, I notice when I put anything in the 'Whitelisted URLs' section and click 'Index my site,' if I go back to the Wizard again, then all of the URLs I put in the box are gone...

  2. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 2 years ago #

    It defaults to the current site for searching. For indexing, you need to index each site individually.

    Also, the settings below on the wizard for the advanced settings, those are only saved if you choose to create a new index, if you use Reindex then it won't save. When you load the wizard screen, your settings won't show up unless you choose to create a new index template (the second drop-down), to use existing settings choose the site from the reindex (the first drop-down).

    To search across sites on the front, try using the shortcode and set the 'sites' value to a comma separated list of site IDs.

    For example:

    [search-engine sites="1,2,3,6,7,etc.."]

    Then once you've put that shortcode into your page, point you search form at that page for searching. It will search across all site ID's supplied. Site ID's can be found in the wp_searchengine_sites table.

    I'll be adding more advanced features to make this easier in the future, so watch for those.

  3. Glazed Donuts
    Member
    Posted 2 years ago #

    I'm not sure I understand. I added the shortcode [search-engine sites="1,2,3,4,5"] to the main index site of our page (index.php), but the shortcode is showing up.

    Where in the HTML code do I put the information to point it to the index.php page where the shortcode is? Here is the code snippet of the search form on our site:

    <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
        <div><label class="screen-reader-text" for="s">Search for:</label>
            <input style="width: 100%; height: 30px; font-size: 25px; border: 1px solid black;"  type="text" value="" name="s" id="s" />
            <input style="font-size: 25px; border: 1px solid black;" type="submit" id="searchsubmit" value="Search our website" />
        </div>
    </form>
  4. Glazed Donuts
    Member
    Posted 2 years ago #

    I actually found out what was going on...
    The shortcode is [search_engine sites="1,2,3,4,5"] ..it's supposed to have an underscore instead of a hyphen.

  5. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 2 years ago #

    You're right, my mistake there, I used a hyphen instead of an underscore in my reply.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic