Search and comments

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Search and comments

Post by Fabien »

Hi,

Is there a possibilty for a visitor of a s9y site to search at the same time in entries and comments?

Cheers, Fabien

PS: the biggest limitation (for me) in Serendipity is the lack of an advanced search function: search in entries and/or comments, within a range of dates, by categories (and & or conditions), by author, by keywords (and & or conditions), etc. Is this feature planned?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Search and comments

Post by garvinhicking »

Hi!

Only if the s9y blog has the plugin 'Searches comments on quicksearch' installed.
PS: the biggest limitation (for me) in Serendipity is the lack of an advanced search function: search in entries and/or comments, within a range of dates, by categories (and & or conditions), by author, by keywords (and & or conditions), etc. Is this feature planned?
You can already use the full range of MySQL boolean search options to make flexible word searches.

Also the plugin "Custom Archive" allows you to filter for specific authors etc.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Post by Fabien »

Thanks a lot, Garvin. I didn't find this plugin. Ah, I am longing for your book!
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Post by Fabien »

Hi Garvin,

I have been unable to find the plugin (comments search) in the Plugins/templates section of the site, and when I try to install it from the administration of my blog, I get the following error:

Code: Select all

Erreur: serendipity_event_commentsearch:b36c024b27f6741c2433dfa0539745fe (online_repository)
DEBUG: Plugin serendipity_event_commentsearch:b36c024b27f6741c2433dfa0539745fe not an object: .
Input: Array ( [adminModule] => plugins [pluginPath] => online_repository [install_plugin] => serendipity_event_commentsearch [spartacus_fetch] => [action] => [adminAction] => ) .

This error can happen if a plugin was not properly downloaded (check your plugins directory if the requested plugin was downloaded) or the inclusion of a file failed (permissions?)
Backtrace:
Installing plugin: Array ( [0] => serendipity_event_commentsearch [1] => [2] => event [3] => 0 [4] => online_repository ) 
INSERT INTO s9y_plugins (name, sort_order, placement, authorid, path) values ('serendipity_event_commentsearch:b36c024b27f6741c2433dfa0539745fe', 24, 'event', '0', 'online_repository')
No valid path/filename found. Aborting.
Classname serendipity_event_commentsearch still does not exist. Aborting.
Loading plugin failed painfully. File not found?
No valid path/filename found. Aborting.
Classname serendipity_event_commentsearch still does not exist. Aborting.

Fatal error: Call to a member function on a non-object in include/admin/plugins.inc.php on line 441
Thanks, Fabien
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Which spartacus mirror are you using?

You can also manually download the plugin from spartacus.s9y.org...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Post by Fabien »

Hi Garvin

I changed the mirror and I installed the plugin (v 1.2).

The problem is that it doesn't seem to work. Just an example. If I search the word Kerala on my blog, the result is that the word is not found. But you can see it on this comment of an entry.

Have you an idea?

Cheers, Fabien
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Hm, that's strange. If the commentsearch plugin was installed, you should get a second box telling you about the search. Are you sure the plugin is active and you have uploaded all files including the plugin_commentsearch_searchresults.tpl file?

It might also be that the fulltext index on the serendipity_comments DB table could not be created, can you check that?

It works on my installation :(

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Post by Fabien »

Hi Garvin,

I have probably not done what is necessary for a correct installation of the plugin.

I have just clicked on the installation icon from Spartacus. The plugin appears in my list of installed plugins and there is no configuration icon next the title.

If I look at the database, there is no fulltext index for the text field of the comment table. Do I have to create it manually?

Is the installation of the plugin documented somewhere? Have I forgotten something?

Thanks for your help.
Fabien
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
I have just clicked on the installation icon from Spartacus. The plugin appears in my list of installed plugins and there is no configuration icon next the title.
That's okay, the plugin itself has no configuration.

Does your plugin list the proper files? Can you download the plugun ZIP manually from http://spartacus.s9y.org/ and see if all files are there?

To try to recreate the missing key, you can either try to remove and reinstall the plugin, or to execute this SQL command:

Code: Select all

CREATE FULLTEXT INDEX commentbody_idx ON serendipity_comments (title, body)
(with phpMYAdmin or so).

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Post by Fabien »

Hi Garvin,

As I said earlier, I can't find the plugin of Spartacus site. I'm probably blind...or dumb. Or there is a problem with this plugin on Spartacus site?

The version downloaded from the administration section of my blog has only three files:
lang_en.inc.php
plugin_commentsearch_searchresults.tpl
serendipity_event_commentsearch.php

I have already tried to suppress and install the plugin. No effect.

I have manually created the index with your SQL command and it works now.

Thanks, Fabien
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
As I said earlier, I can't find the plugin of Spartacus site. I'm probably blind...or dumb. Or there is a problem with this plugin on Spartacus site?
Oh, I didn't get that, I'm sorry. It seems the plugin is not shown because its missing a group assignment. Check this ZIP:

http://spartacus.s9y.org/cvs/additional ... search.zip

I've fixed it for the next update.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Post by Fabien »

Hi Garvin,

So, apparently no file was missing.

Follow-up:

It seems that there are little display problems of the results.

The comments search results are listed like this (example here):
date: authorentry_title
first lines of the comment
A space is missing:
date: author entry_title
first lines of the comment

The date is written:
day, date (ex: Monday, 1 june 1912)
The problem is that my blog is written in French and this is not correct. So it would be better that the tpl file can be different for each language and to have the possibility to customize it more.

Globally, the plugin solves the problem, but the result is not very beautiful. The results of the comments search are displayed at the bottom of the page, after the pagination commands.
And if the entry search results are on several pages, the comment search results appear on every page! (see this for example)

So I always think that S9Y deserves a beautiful advanced search funtion: the classic quick search on a side bar and just below a "More options" link going to a page similar to the search function of phpbb or, for example, the one used in the Expression Engine search (see here an example). But better of course (with a sort function by date, author, tittle). It's Serendipity!

Cheers, Fabien
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Yes, you can control the layout of the results through the .tpl template file! Also the date format should be adjustable there.
The results of the comments search are displayed at the bottom of the page, after the pagination commands.
This sadly very much depends on your template and where/how it places the page footer smarty variables.
And if the entry search results are on several pages, the comment search results appear on every page! (see this for example)
Yes, search results for entries and comments cannot be combined, so they need to be seperated. :(
So I always think that S9Y deserves a beautiful advanced search funtion: the classic quick search on a side bar and just below a "More options" link going to a page similar to the search function of phpbb or, for example, the one used in the Expression Engine search (see here an example). But better of course (with a sort function by date, author, tittle). It's Serendipity!
Sure, a plugin for that could be built - the custom event hooks for plugins emitting their own pages are available.

For me, the search options using the custom archive plugin and a google site search are pretty sufficient, so I leave it up to other developers who might have different thoughts about that. :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Post by Fabien »

:cry: :cry: :cry: :cry: :cry:

Nevertheless, I understand that you have a lot of other work to do.

Thanks for your help,
Fabien
Post Reply