Incorporating a site search class

edited March 2011 in Feature Requests
Was wondering if anyone has built a site search for fuelCMS. I need something that would crawl the rendered pages rather than search database tables so that it can be used for each new site that gets built no matter what modules the site might consist of. I saw an article on "How to use Zend_Search_Lucene with the PHP framework CodeIgniter" but that really seems overkill. Wondered if anyone had found or built a simple search class that had been used with fuel. The plan is to use it as the 'site search' in a WIBIYA toolbar.

Comments

  • edited 2:49PM
    I was able to build a search successfully. Thanks. Actually ended up creating my own but am using the 2nd uri segment for the search term because the client wanted the WIBIYA toolbar for their local search. The WIBIYA instructions are to do a search locally for AAAA and then paste in their settings what the resulting url is. Of course in my setup that is sitename.com/search/search term.

    The WIBIYA toolbar submits to the search page by appending the search term properly as a uri segment. It all works fine until any special character is entered like a period and then it points to the 404 not found page. Doesn't look like there's an option to post the search term with WIBIYA so is there a way to enable querystring for just one page? What are my options?
  • edited 2:49PM
    You can use the $this->uri->init_get_params() which will give you back anything in the query string. CI 2 supports query strings as well although I haven't looked too much into it. I noticed in earlier versions of CI at least that there needed to be more then one query string option for it to properly work in some cases.
  • edited 2:49PM
    I punted. It looks like that method wasn't completed. Anyway, since there's always only one querystring variable and will always look like this:
    website.com/search/?search=A. search term with extra characters
    I did this and it seems to work just fine now.
    $querystring = $_SERVER['QUERY_STRING']; $term = urldecode(substr($querystring, 7));
    Not the most elegant solution but it works for now. Doesn't seem to be unsafe since it's just sandwiched into a select statement.
    Thanks
Sign In or Register to comment.