Search

I'm cobbling together a basic regex search function for a blog area as I'm much of the way through a 2.4 site and the search extension isn't compatible :(

To be honest it's working pretty well, however I have an issue in that I need to add a secondary filter for a field that's already being filtered.

So my filters are currently:

  • Title: {$title}
  • Category: {$category}
  • Content: regexp:{$url-keywords}

The URLs are formed like so: domain.tld/blog/{$category}/{$title} hence the first two filters.

So the above regex filter works fine for searching the content, but I'd also like to be searching the title. Is this possible? I notice that I can't add the same field as a filter again, but can I include two options for filtering in the filer, i.e.

Title: {$title} or regexp:{$url-keywords}

Or am I being mad?

I'm considering using the ID for the actual filter, as it helps rule out duplication issues, i.e. domain.tld/blog/{$category}/{$id}/title-string so the SEO benefits remain but the title doesn't have to be used for the filter. So this is an option, I think.

Edit: Actually the above solution doesn't work anyway because of course I can't filter two fields by the same filter, as the search query would need to exist in both, not either.

Would the Datasource Multiplier extension work here?

http://symphonyextensions.com/extensions/ds_multiplier/

Afraid to ask but is anyone up for an 2.4 update for the search-index extension? i would really appreciate it! Don't know how much work it would be and i know it's deprecated, but i'm not to confident doing it myself unfortunately.

@nathanhornby i have noticed you started to make an effort already

@Cremol Yup I've done everything within my ability - I'm hoping someone already familiar with it can jump in and make the final tweaks!

@moonoo2 Maybe! I'll have a play, thanks.

Ultimately though I suppose a custom datasource could do this, I need to get more in the habit of getting into the code.

regexp:{$url-keywords} seems to work quite good as an alternative.

I've been thinking about filtering on a textarea and title field.
I think this could be done with the reflection field extension.
Reflecting title and text area and use the filter on the reflection field...
Think this might work but maybe a bit of overload in the datasource?

@nathanhornby any luck with the custom datasource?

@Cremol Unfortunately I've had to leave this how it is, budget constraints and time issues! I like your idea of using the reflection field to combine the data, that's clever! No idea how it would effect performance though.

Filtering on the text area will do for me as well for now, it's a pretty decent solution!

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