Search

I was trying to solve the problem I explained here, and the same error was occourring with others special characters like 'ú', 'á'...

I imagine it may be a simple thing to fix, but I'm not able to find out why it's happening. If somebody could help me, I would be thankful.

I'm getting this javascript error in the backend: Symphony.Context.get("searchindex") is undefined [Break On This Error] this.refreshrate = Symphony.Context...ex')['re-index-refresh-rate'] * 1000;

Also, after editing a section in the indexes part, the save won't save, I just get to the list of all my sections and the fields etc are not stored.

Does anybody know what's wrong here?

does anyone know what this error is:

You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near 'ELSE 1 
END / SQRT(GREATEST(1, DATEDIFF(NOW(), creation_date))) ' at line 14
An error occurred while attempting to execute the following query
SELECT SQL_CACHE SQL_CALC_FOUND_ROWS e.id as `entry_id`, data, e.section_id 
as `section_id`, UNIX_TIMESTAMP(e.creation_date) AS `creation_date`, ( IF(LOCATE('vanilla', 
LOWER(`data`)) > 0, 1, 0) + 0 ) AS keywords_matched, ( ((LENGTH(`data`) -   
LENGTH(REPLACE(LOWER(`data`),LOWER('vanilla'),''))) / LENGTH('vanilla') + 0) * CASE 
ELSE 1 END / SQRT(GREATEST(1, DATEDIFF(NOW(), creation_date))) ) AS score FROM 
sym_mrzf_v2_search_index as `index` JOIN sym_mrzf_v2_entries as `e` ON (index.entry_id = 
e.id) WHERE index.data LIKE '%vanilla%' AND e.section_id IN ('1') ORDER BY (keywords_matched * 
score) desc LIMIT 0, 10

(lines broken up for readability)

i just pulled the latest version from git and these two files were updated:

 content/content.logs.php
 lib/class.search_index.php

do i need to "uninstall" then "install" for changes from those files to be seen on my site?

EDIT: weird, i uninstalled the extension, re-enabled it, and then redid the indexes for the search and it seemed to have worked. I could have possibly just redone the indexes and it could have possibly worked as well, but for now, i'll never know =). It could have been that when I moved this site from one server to another, something got screwed up.

Can I make this extension work with the search-box I have already on my site (http://test.tamarawobben.nl)?

Nick's readme is great.

I try to follow it but I have two problems.

1) the readme stated :

Attach this data source to a page and invoke it using the following GET parameters:
 • keywords the string to search on e.g. foo bar 
• sort (default score) either id (entry ID), date (entry creation date), score (relevance) or score-recency (relevance with a higher weighting for newer entries)
 • direction (default desc) either asc or desc 
• per-page (default 20) number of results per page
 • page the results page number
 • sections a comma-delimited list of section handles to search within (only those with indexes will work) e.g. articles,comments

As far as I know I can do this in the datasource only. But if I choose it I only see the name and the author. I use Symphony 2.2.5.

2)

Your search form might look like this:
<form action="/search/" method="get">
    <label>Search <input type="text" name="keywords" /></label>
    <input type="hidden" name="sort" value="score-recency" />
    <input type="hidden" name="per-page" value="10" />
    <input type="hidden" name="sections" value="articles,comments,categories" />
</form>

 Note that all of these variables (except for keywords) have defaults in config.php. So if you would rather not include these on your URLs, modify the defaults there and omit them from your HTML.

Do I understand it right that I only have to put the keywords rule in my search form or must I use the wole code.

Nobody who can give me help. And if I have this url: http://test.tamarawobben.nl/search-page/?keywords=appelgebak. How can I debug this search to see if it's working.

add &debug to the end of your urk above: so it would be ?keywords=applebak&debug

How can I debug this search to see if it's working.

Try http://test.tamarawobben.nl/search-page/?keywords=appelgebak&debug

Hah.. synchronised posting!

I've never used the custom data source, I've only searched individual sections separately.

It's a long weekend here in the US, so not everyone is back to work yet. I'm not sure about other places, but you may get some better answers tomorrow.

Hah.. synchronised posting!

Looks like you beat me by one hundredth of a second :)

Then I see a invalid search section error message in the xml so it seems that I have to do the steps that i don't understand in a section.

Then I see a invalid search section error message in the xml

Have you created indexes that correspond to the sections you want searched?

yes, I have. As far as I know I do all the steps in the way the readme states.

Nobody who can help me on the way ?

Do I understand it right that I only have to put the keywords rule in my search form or must I use the wole code.

You can just send keywords (a URL like /page/?keywords=foo+bar) is sufficient, as all the other values have defaults (as specified in the README). However sections will also be required if you have not set these defaults in the config file.

So I have to make the sections in the config file so I don't see the sections error anymore.

Edit 1 :

I put this line into manifest/config.php :

'sections' => Sections, Dagboek ,

But still the invalid search section error message

Roelof, where can we check/see your search page? test.tamarawobben.nl/search-page/ seems to be an empty page and the search-form on your homepage is not set up to be used with the Search Index extension.

When you've change the default Search Section's in the config.php you should make sure you don't redefine these in your form HTML code (so remove or change the default <input type="hidden" name="sections" ..>)

You have correctly added the custom Search Index data source to your Search Page?

As test I use now this page : http://test.tamarawobben.nl/search-page/?keywords=appelgebak.

My html code for the search box is :

<div id="search">
        <form method="get" id="searchform" action="http://test.tamarawobben.nl/">
          <input type="text" value="" name="s" id="s" class="txtField" />
          <input type="submit" id="searchsubmit" class="btnSearch" value="Find It " />
        </form>
      </div>

And i added the Search index to the search page.

Roelof

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