Search

I'm probably being optimistic - but I seem to have gotten the extension running (at least installed and able to save changes) by replacing a single function that was deprecated.

saveConfig() has been replaced with write().

extension.driver.php

- 107: Administration::instance()->saveConfig();

+ 107: Symphony::Configuration()->write();

class.search_index.php

- 39: Symphony::Engine()->saveConfig();

+ 39: Symphony::Configuration()->write();

As I say, probably just the tip of the iceberg, but you never know! I just poked until the errors stopped - and the settings seem to stick - but I'm sure DesignerMonkey has more insight than I :)

I issued a pull request with the above changes - but they'll need looking over by a Symphony veteran.

To add to the above - although the changes in class.search_index.php cause the errors to subside, it only seems to save *some* of the settings. The index 'filters' don't seem to save, just the 'Included fields'.

And that function above seems to be a little more widely used (Also in Synonyms, for example). However that can be fixed by replacing line 498 in class.search_index.php with

- 498: Symphony::Engine()->saveConfig();

+ 498: Symphony::Configuration()->write();

Probably easier at this point if I just link to my pull request:

I also updated the selectable tables code, as they weren't working either (some changes to the way that works in 2.4 apparently, had to make the change on another extension yesterday).

Use at your own risk - but seems to do everything but commit changes to anything under the banner of 'Index filters'.

No idea whether the actual search itself works, mind you :)

Cant handle "&" when indexing (open issue on Github). To elaborate, only if an ampersand is pulled as an excerpt, an XSLT processing error occurs: loadXML(): xmlParseEntityRef: no name in Entity, line: 310. /var/www/.../symphony/lib/toolkit/class.xsltprocess.php:135. If Search Index has been abandoned, has anyone got any pointers as to how I might go about a dirty fix for this? I have basic PHP skills.

Since I posted this, I've crow-barred in a dirty fix after line 414 (v0.9.2) in search_index/data-sources/data.search.php

$markdowncode = array('######', '#####', '####', '###', '##');
$excerpt = str_replace($markdowncode, '', $excerpt);
$excerpt = str_replace('&', '&', $excerpt);
$excerpt = str_replace('…', '…', $excerpt);

This raises another point, the except pulls in raw Markdown code which is why I've replaced hashes/pounds. Replacing URL Markdown would take longer than time I have. Search Index UI doesn't offer 'unformatted' like Data Sources do, but is there a Symphony PHP function already existing that I can apply to $excerpt?

I have Search Index running on this site. When searching for the term 24" an error is thrown:

loadXML(): attributes construct error in Entity, line: 498 /srv/www/horizontelecom.co.uk/publichtml/symphony/lib/toolkit/class.xsltprocess.php:135 XML Debug loadXML(): Couldn't find end of Start Tag keyword line 498 in Entity, line: 498 /srv/www/horizontelecom.co.uk/publichtml/symphony/lib/toolkit/class.xsltprocess.php:135

Can anyone tell me how to protect the search function against special characters. The error seems to be thrown by the core rather than the extension. Thanks

The extension will need looking at to change the character to something that XSLT won't break on.

The error is XSLT trying to use it, and properly breaks because it isn't 'escaped' so to speak. I'm not sure however how to fix it :(

Trying to implement search and keep getting this error:

Unknown column 'score' in 'order clause'

@mmcglynn

What version of Symphony? It's not currently compatible with 2.4, most of the fixes are in this pull request, but I need someone to finish it off (hint hint!).

Hey guys, I've done a little bit extra on top of Nathan's commits and it looks like this is back up and running on Symphony 2.4. Let me know if you run into any difficulties, there is probably a couple of stray bugs still around.

@brendo +1,000,000

I Still have a problem while editing an entry via a frontend form.

And another error :(

Thank you so much, nathanhornby and brendo!

Everything seems to work fine except for the keyword-suggestions-DS.

I'm confused about hard coding the sections that I want to build entries for.

This works:

?keywords=foo&sections=Page-Content

I don't know what config.php wants in terms of hard coding the section.

These all fail:

'get-param-sections' => 'sections=Page-Content',

'get-param-sections' => 'Page-Content',

'get-param-sections' => 'sections',
'sections' => 'Page-Content',

From the README

'default-sections' => 'page-content'

The value you are changing refers to what the GET parameter key is associated to section overriding. For example, 'get-param-sections' => 'content, means the URL can be ?keywords=foo&content=page-content. More that here.

Setting default-sections means you don't have to include it in the request, so ?keywords=foo will work :)

Hi all,

Maybe I'm missing something, but is there a way (like with CacheLite) to get the site to re-index a section when a new entry is added, or an entry is edited?

I'm liking the extension but for any site where content is regularly added (not unlikely) it seems a bit clunky to have to manually go and reindex all the time.

Cheers!

It should do it out of te box. No problems on a 2.3.6 install

@plenaforma Ah ok. I couldn't find any reference to this functionality so had just assumed it didn't do it. So as standard it will run a re-index whenever an entry in an indexed section is created or edited?

Edit: Just tested and the indexed count does go up when adding an entry! I'll mention something on Github about adding this to the docs, unless I just missed it I think it;s worth mentioning!

Thanks

Yup, that's the way it works.

Hi All

Has anyone managed to get Search index working on Sym 2.5?

Thanks

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