Info

Donations: view link
Category: tools
Licence: GNU General Public License (GPL) version 2
Updated: 25 days ago
Downloaded: 603

Releases

Latest: 2.0

Previous releases:
None
More projects by Jerome Bakker:

3

Recommendations

Summary:

Provides Full Text Search Capabilities

Full description:

This plugin is an edited version of jimbob's Full Text Search.

This version is somewhat cleaner and offers search result filtering based on registered subtypes

Installation instuctions:

  • place in mod directory
  • enable plugin
  • edit {document_root}/search/index.php
    • comment out line 63 to 84
    • insert 'trigger_plugin_hook('search','',$tag,"");' after the comment block you just created

Please leave your comments and bug here.

NOTE: This plugin has NOT been tested on Elgg 1.6

========================================

(c) 2009 ColdTrick IT SolutionsLike this plug-in? Consider making a donation.

Release notes:

Ander Goñi has released a Basque and Spanish translation for this plugin (check here: http://community.elgg.org/mod/plugins/read.php?guid=418391)

Thanks for this ;-)

Simox 189 days ago

Great job Jerome - a huge improvement on the previous version!

jimbob 188 days ago

It works great in Elgg 1.5.

However, when I attempted install it in Elgg 1.6, I got a syntax error in line 63. Basically, it is the line  which has: 'trigger_plugin_hook('search','',$tag,"");

W. Kennedy 188 days ago

@w. kennedy: I check the core files of 1.6 and it should work the same. Are you sure you didn't comment out too much? The comment block should start after the IF statement which makes the submenu's and end after page_draw();. Then you can insert the line trigger_plugin_hook('search','',$tag,"");

Hope this helps, let me know please

Jerome Bakker 187 days ago

Can anyone confirm this works on 1.6?

elgg_noob 187 days ago

i got elgg 1.6.1 and it seems to work. when does the syntax error appear?

here my code at the end of the index.php (is it correct?):

/**        if (empty($objecttype) && empty($subtype)) {
            $title = sprintf(elgg_echo('searchtitle'),$tag);
        } else {
            if (empty($objecttype)) $objecttype = 'object';
            $itemtitle = 'item:' . $objecttype;
            if (!empty($subtype)) $itemtitle .= ':' . $subtype;
            $itemtitle = elgg_echo($itemtitle);
            $title = sprintf(elgg_echo('advancedsearchtitle'),$itemtitle,$tag);
        }
       
        if (!empty($tag)) {
            $body = "";
            $body .= elgg_view_title($title); // elgg_view_title(sprintf(elgg_echo('searchtitle'),$tag));
            $body .= trigger_plugin_hook('search','',$tag,"");
            $body .= elgg_view('search/startblurb',array('tag' => $tag));
            $body .= list_entities_from_metadata($md_type, elgg_strtolower($tag), $objecttype, $subtype, $owner_guid_array, 10, false, false);
            $body = elgg_view_layout('two_column_left_sidebar','',$body);
        }
       
        page_draw($title,$body);
*/
trigger_plugin_hook('search','',$tag,"");
?>

FraBle 186 days ago

I would to report that my second attempt to install this plugin in Elgg 1.6 was successful. Excellent plugin !

Furthermore, I have discovered an important benefit of this plugin, versus JimBob’s plugin, which is its ability to recognize (as tags)  subtypes such as categories created by Diego’s GroupExtended plugin. In contrast, JimBob’s plugin does not recognize them as tags. For example, when you have this plugin and GroupExtended installed, if you create 2 groups and classify them under Organizations category and then click on the category, “Organizations”, you will be transferred to a search page that lists these 2 groups.

W. Kennedy 186 days ago

Hi @Jerome  thx for this plugin.

I did the same thing that @FraBle did.  Just want to make sure I did that right.

So now, the search bar in the elgg toolbar is using this full text goodness? is that correct?

How can I make search block appear on custom index?

Thx again for this much needed and great addition to elgg.

elgg_noob 185 days ago

@elgg_noob: All search queries are now Full Text !!! ;) Not just the Top Bar.

I don't think the is a view to get a search box, so just make a small form with an input text and a submit button. The action should be  '[wwwroot]/search'. The input field should be named 'tag' and the method should be 'get'. Then you have your search on the index page.

Hope this helps

Jerome Bakker 184 days ago

Hi @Jerome i want to now something, with this plugin i can just choose if the search it's inside of an entitie or just search on allll the content (titles, descriptions, tags, .....else)? thanks for your answer @Jerome ;)

dgfrancisco 179 days ago

@dgfrancisco: No you cna't chose. It always searches within all the content.

Jerome Bakker 178 days ago

I must be doing something wrong.  I have followed Jerome's instructions and after enabling in the Tools Administrator, the widget does not appear on the Default Dashboard or the Default Profile sections.  I unzipped the folder into the MOD folder so I have a MOD/CustomSearch folder.

Shouldn't the dashboard / profile sections pull from there?

Thank you in advance,

Andrew

Andrew Perlmutar 178 days ago

@andrew: This plugin is not a widget, it overrules the search (eq in the topbar). So every search you perform on your site will be based on the full text, not just the tags of een object.

Jerome Bakker 177 days ago

Thank you Jerome,  excuse me but I am an ELGG newbie (as if you couldn't guess).  I don't have the search on my site for some reason.  I thought that it would be there by default.  Do I need to create a search form?  If so, what are the parameters?

Andrew Perlmutar 177 days ago

installed on 1.6 works a treat thanks for the effort you put into this :)

Does anyone know if its poissible to target the search at specific areas or add excluded areas from the search, if it is then my life will be complete :)

backtogeek 165 days ago

@backtogeek: On the left in the menu you can limit your search to certan subtypes. But these have to be registered by the plugins to show up.

But once you see the search url, you can point it to other subtypes (very advanced browser usage ;))

Jerome Bakker 164 days ago

Thanks for the responce Jerome, maybe I am being a total biff but I do not see a menu on the left that pertains to the search plugin?

backtogeek 157 days ago

@backtogeek: see my screenshot what i mean

image

Jerome Bakker 156 days ago

aaah thanks Jerome, I missunderstood I was looking for somthing in the administration to select the subtypes ( would be a great feature )  ;)

So is there a way to alter the code in the search url to only look at the user content subtype?

image

backtogeek 156 days ago

my url is http://arttakepart.org/pg/search/?tag=art&subtype=form_data&object=object&tagtype=&owner_guid=0

so i guess my subtype is form_data

with my limited php knowledge I am guessing the section of the code to be altered would be in /mod/customsearch/index.php

<?php
 global $CONFIG;
 
 set_context('search');
 
 $searchstring  = get_input('tag');
 $tag    = $searchstring;
 $search_min_size = 2;
 
 if(!empty($tag) and strlen($tag) >= $search_min_size){
  $allowedTypes = array();
  $added   = array();
  
  $allowedT = get_all_subtypes();
  foreach ($allowedT as $key => $subT) {
   foreach($subT as $k => $v) {
    $allowedTypes[] = $v;
   }
  }

little help ?

:)

backtogeek 156 days ago

Very nice plugin indeed and is looking good with 1.6.1, there is only one thing I've found.

Case: when you search for something and type into search box something containing symbol >>> '

Example: car's

Then you will get a database request error. Going to ELGG_ROOT/mod/customsearch/index.php and changing line 6 to >>> $searchstring = addslashes(get_input('tag')); will get you over it. Maybe there is a better solution. Any ideas?

Pjotr 121 days ago

@Pjotr: LOL, I don't know how 's are stored in the database. I will look into it and check out your solution.

However the update will most likly NOT come before Elgg 1.7

Jerome Bakker 121 days ago

That should work just fine, I guess. Thanks for the great plugin, it saved me a lot of time and headache.

Pjotr 121 days ago

Hey, found one more thing. You can get a fatal error if one of the results you get is something like "false".

You should add to "index.php" >>> around line 127 >>> "$entitiesList[] = $entity;"

You should add there one additional "if" statement >>> "if ($entity instanceof ElggEntity)", so that anything that is does not originate from "ElggEntity" class would not be added. Currently you can get blank page, because any errors are hidden. And the error behind the scene is:

"Fatal error: Argument 1 passed to elgg_view_entity() must be an object of class ElggEntity, called in /home/gnum/public_html/koolielu/views/default/search/entity_list.php on line 49 and defined in /home/gnum/public_html/koolielu/engine/lib/elgglib.php on line 592"

Also the number of found objects will always be right from now on.

Pjotr 107 days ago

Hi,

very nice plugin, but I want to exclude some subtypes. Is it possible? And how?

Thanks!

n_l1 4 days ago