Search

A new extension, “Search Index” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

As mentioned briefly at Symposium 2010 this is my attempt at a site search extension. Because of the extra delegates and API usage this is compatible with Symphony 2.0.8 or newer.

The README is rather verbose, so I will try to summarise here:

This extension lets you configure how an entry should be indexed, ready for searching. For each section you can choose which fields should be used to build the index data. You can also specify filters to ensure that only entries you want to be indexed, are indexed. Much like a Data Source.

Indexing occurs in two places:

  • when you create/edit an entry, it will be re-indexed
  • manually re-indexing an entire section (from Blueprints > Search Indexes)

You can then implement search in two ways:

  • search a single section by adding the “Search Index” field to a section and filter on it using a Data Source
  • use the bundled custom “Search Index” Data Source (README includes instructions of parameters it accepts) to search multiple sections and implement more of a “site search”

The single-section search (with a native Data Source) lets you add keyword searching alongside your other filters, which will output normal <entry /> XML. The custom Search Index Data Source outputs very simple XML, and entry IDs which you then use to build your own XML for the entries found.

Awesome! Nick, thank you for pulling this functionality together. I look forward to trying out this extension soon.

WTF! I thought you were out visiting family all weekend. Do you code in your sleep?

This is brilliant, Nick.

It was finished last week, I just wanted to get it out before the Madness of Monday Morning ensues!

Rock on Nick!

And again, the sun is shining. I’m sure this extension will be put to good use, thanks!

Am I being a bit quick to ask if this works with the Symphony 3.0 beta?

Am I being a bit quick to ask if this works with the Symphony 3.0 beta?

You are indeed. One step at a time ;-)

Just submitted an issue.

hey nick, just tried installing this on a 2.1 install, but upon page refresh, the extension is still disabled. I looked in my server error logs, but I’m not seeing anything in there.

Hi Nick,

just started playing with this extension and I really like it :-)

And I made a tiny change that allows me to set default sections to search in. Line 61 in data.search.php now reads

$sections = isset($get[$param_sections]) ? $get[$param_sections] : Symphony::Configuration()->get('default-sections', 'search_index');

with a corresponding default-sections key in the search_index-array in config.php.

Thanks Nick. This is a great implementation.

Awesome extension Nick. Works a treat.

One question though, is there a way to speed it up when there are thousands of entries to search through?

I have around 3000 products and it takes about 45seconds every search, I’m assuming because there are so many products to filter through.

Also, I can only get this to work with the single section option. I attached the provided DS to my search results page, indexed the sections through the extension and set the form to get with url param keywords but it returns invalid section error everytime…Have I missed a step??

I think I am suffering from Friday-itis.

Cheers!

Phill

I have around 3000 products and it takes about 45seconds every search

Yikes, the frontend search or the indexing of the section? What happens if you remove filters? What happens if you remove the sorting? Is it just this one Data Source that’s slow? Could I see the Data Source list from your ?profile?

but it returns invalid section error everytime

Could you post an example of the GET URL parameters you end up with please?

oops…forget about it lol I was having a very blonde moment. I mispelled ‘secions’ in the form name hahahaha

Sorry to waste your time!

face palm

No probs :-)

Search Index updated to version 0.3a on 20th of October 2010

WARNING unfortunately this isn’t backwards compatible with previous versions. You’ll need to uninstall then re-install this version, which will delete your existing indexes. Sorry.

Thanks for the update, Nick. As a present an issue.

Search Index updated to version 0.4 on 9th of November 2010

From the README:

  • fixed several bugs (thanks designermonkey, Allen, klaftertief, icek, zimmen!)
  • added additional indexes to sym_search_index and sym_search_index_logs for mega performance improvement for single-section search, it is recommended you make sure indexes in your tables match these:
    • sym_search_index: KEY 'entry_id' ('entry_id') and FULLTEXT KEY 'data' ('data')
    • sym_search_index_logs: FULLTEXT KEY 'keywords' ('keywords')
  • refined excerpt code
  • added option to use pretty URL Parameters instead of $_GET params only
  • added Symphony 2.1.2 readiness

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details