ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Search from outside an EE page

April 27, 2012 2:38am

Subscribe [3]
  • #1 / Apr 27, 2012 2:38am

    james Brown

    492 posts

    I have a client site where EE is used for part of the content, mainly the blog and help documentation. They want to have a search that is used both on the EE and non-EE pages that allows a user to search the EE blog. Is this possible? I know it is easy for any page that resides in EE, but what about when the search box resides outside an EE page?

  • #2 / Apr 27, 2012 12:15pm

    Neil Evans

    1403 posts

    In theory, EE will only search what is within its own database. So pages outside that database that are either in a different CMS or static HTML will not be searched…
    If the other pages are stored in another CMS, then you could easily use a custom database query and include that.

    But to be honest when searching multiple sources and location, even across subdomains, and domains, you might be better integrating a search engine such as google to do this for you.

    I have used: http://www.google.com/enterprise/search/products_gss.html
    plus http://gotolow.com/addons/low-googlesearch

    before to a great level of success.

  • #3 / Apr 27, 2012 12:42pm

    RedSeal

    7 posts

    Sorry, maybe I didn’t explain myself fully. I am not wanting EE to search any content that is outside of EE. I am wanting a search box that will search EE contents, but that box would be located on pages that are not EE pages. It would be on the same domain, just not under EE. Is that possible?

  • #4 / Apr 27, 2012 12:53pm

    Neil Evans

    1403 posts

    okay, so the search form submits from outside, i see…

    i believe EE introduces a number of hidden fields to the search for, for example:

    <form method="post" action="http://domain.com/index.php"  >
    <div class='hiddenFields'>
    <input type="hidden" name="ACT" value="2" />
    <input type="hidden" name="XID" value="hashstring5b87c938f58cd7f0d8f73442ba0d" />
    <input type="hidden" name="RES" value="10" />
    <input type="hidden" name="meta" value="longhashstringrNXWN45xkaPUqK" />
    <input type="hidden" name="site_id" value="1" />
    </div>
    
    <input type="text" name="keywords" id="keywords" value="Search…" />
    <input type="submit" name="g" id="g" value="Go" />
    </form>

    So i would imagine that you cannot pass anything pretending to be this form from outside EE as otherwise it would be a great way to DDOS an EE site!
    However, that would not stop you writing your own code to query the database directly.

  • #5 / Apr 30, 2012 10:37am

    Dan Decker

    7338 posts

    Hi James,

    Have a look at Google Custom Search - looks to be just what you are after!

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases