Full Text Search v0.8

Release Notes

This plugin allows users to search your elgg site via full text and not just tags.

Revamped for 1.5 - Please provide detailed bug reports so that they can be ironed out quickly.
-----------------------------------------------------

Installation:

Upload and enable

Edit [rootdirectory]/search/index.php and change the last line from

page_draw($title,$body);

to

// page_draw($title,$body);

-------------------------------------------------

Funding of this plugin provided by www.Schools.ac

 image

  • Hi, thx this is a cool plugin. Unfortunately the results page appears twice. Why?

    Many greetings,
    Cube

  • Please read the installation instructions above.

    You need to comment out the last line of /search/index.php which prevents this happening.

  • Just to be clear, edit from elgg root directory, not mod directory, /search/index.php

  • Hello dear jimbob. I have naturally followed your instructions, did not I outside of the / mod directory, the line of code must be entered. Now I know it and it works ;-)

    THX
  • Glad to hear all is well :)

  • Well thank you indeed ;-)
    Even though I do not have a real need for this..
    It is nice to see you're sharing the PlugIn..
    Thank You...

  • fantastic work jimbob - thank you

  • jimbob, i18n'ed version of your cool mod will be provided to you shortly, I hope - we already use fulltext serach in Elgg Russia

  • hey jimbob - this completely screws up the profile_menu plugin which i love..

  • sunirmalya - have you tried changing the order of the plugins to see if that helps?

  • sorry jimbob - i should have been more explicit. Both plugins keep working fine, but the search bar has the elgg logo and profile stuff repeated.

  • I'm not familiar with the profile_menu plugin, but it sounds like both plugins are overwriting the elgg_topbar.php file.

    Try moving profile_menu below customsearch. If that doesn't work, edit mod/customsearch/views/default/page_elements/elgg_topbar.php and remove the elements that are repeated and that should sort it out.

  • Hi Jimbob,

    Thanks for the plugin.

    Is it possible to put Users, Tags, All in different order in the drop-down box.

    in this order:

    All
    Tags
    Users

    so the landing page for:

    http://www.yourdomainname.com/search/?tag=ABC&owner_guid=0

    will be All pages matching ABC by default, not Users matching ABC

    Many Thanks

    Shu

     

  • Edit /mod/customsearch/views/default/page_elements/elgg_topbar.php and replace it with the code below (or edit it as you wish it to appear);

    <?php

     /**
      * Elgg top toolbar
      * The standard elgg top toolbar
      *
      * @package Elgg
      * @subpackage Core
      * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
      * @author Curverider Ltd
      * @copyright Curverider Ltd 2008
      * @link http://elgg.org/
      *
      */
    ?>

    <?php
         if (isloggedin()) {
    ?>

    <div id="elgg_topbar">

    <div id="elgg_topbar_container_left">
     <div class="toolbarimages">
      <a href=http://yourdomain.com><img src="<?php echo $vars['url']; ?>_graphics/elgg_toolbar_logo.gif" /></a>
      
      <a href="<?php echo $_SESSION['user']->getURL(); ?>"><img class="user_mini_avatar" src="<?php echo $_SESSION['user']->getIcon('topbar'); ?>"></a>
      
     </div>
     <div class="toolbarlinks">
      <a href="<?php echo $vars['url']; ?>pg/dashboard/" class="pagelinks"><?php echo elgg_echo('dashboard'); ?></a>
     </div>
            <?php

             echo elgg_view("navigation/topbar_tools");

            ?>
             
             
            <div class="toolbarlinks2">  
      <?php
      //allow people to extend this top menu
      echo elgg_view('elgg_topbar/extend', $vars);
      ?>
      
      <a href="<?php echo $vars['url']; ?>pg/settings/" class="usersettings"><?php echo elgg_echo('settings'); ?></a>
      
      <?php
      
       // The administration link is for admin or site admin users only
       if ($vars['user']->admin || $vars['user']->siteadmin) {
      
      ?>
      
       <a href="<?php echo $vars['url']; ?>pg/admin/" class="usersettings"><?php echo elgg_echo("admin"); ?></a>
      
      <?php
      
        }
      
      ?>
     </div>

    </div>

    <div id="elgg_topbar_container_right">
      <a href="<?php echo $vars['url']; ?>action/logout"><small><?php echo elgg_echo('logout'); ?></small></a>
    </div>

    <div id="elgg_topbar_container_search">
    <form id="searchform" action="<?php echo $vars['url']; ?>search/" method="get">
       <input type="text" size="21" name="tag"
            <?php if(get_input('tag')){ ?>value="<?php echo get_input('tag'); ?>" <?php }else{?> value="Search"<?php }?> onclick="if (this.value) { this.value='' }" class="search_input" />
        <select name='searchType' id='searchType'>
     <option value="fulltext" <?php if(get_input('searchType')=='fulltext'){ echo "selected ";} ?>>Site</option>
        <option value="users" <?php if(get_input('searchType')=='users'){ echo "selected ";} ?>  >Users</option>
        <option value="tags" <?php if(get_input('searchType')=='tags'){ echo "selected ";} ?>>Tags</option>
        </select>
        <input type="submit" value="Go" class="search_submit_button" />
    </form>
    </div>

    </div><!-- /#elgg_topbar -->

    <div style="clear:both;"></div>

    <?php
        }
    ?> 

     

    You may also want to change the side bar order on /mod/customsearch/index.php by editing line 11 onwards to the following code;

     /* side bar menus */
    $CONFIG->submenu['a'] = '';
    add_submenu_item(elgg_echo('Site'), $CONFIG->wwwroot . "search/?tag=" . urlencode($tag) . "&searchType=fulltext");      
    add_submenu_item('Users', $CONFIG->wwwroot . "search/?tag=" . urlencode($tag) . "&searchType=users");
    add_submenu_item(elgg_echo('Tags'), $CONFIG->wwwroot . "search/?tag=" . urlencode($tag) . "&searchType=tags");

  • Works a treat. Thanks!!!

  • jimbob,

    Great plugin!  What bug fixes/improvements have been made since version 0.41?

     

    Thanks!

  • dbrilhart - It is updated for 1.5 and so far no bug reports, so fingers crossed... aside from that the functionality remains the same - good old honest search that Elgg was so desperately needing.

  • Jimbob,

    This is a very useful plugin. One problem I have found with it is that it does not search users last names only first names.  Please put this on your enhancement list.

  • Jimbob, Brent,

    I observed the same behavior in both the standard search and the plugin.  The behavior seems to be the result of an function in the elgg engine rather than of the plugin code.    Specifically, look at the definition of the function search_for_user (in engine/lib/users.php).  In the function definition, the statement

          $query .= "(u.name like \"{$criteria}%\" or u.username like \"{$criteria}%\")" 

    matches the search critera, to the the beginning of the target string.

  • And, of course,

         $query .= "(u.name like \"%{$criteria}%\" or u.username like \"%{$criteria}%\")"

    would match an occurence of $criteria anywhere in the target string.

  • hello jimbob,

        I'm running into a problem when a fulltext search has a lot (>500) results.   When this happens, the search is apparently dying in database.php in the get_data method in the while loop that is populating resultarray[].  It consistently dies after about 15 seconds (wall clock).   I cannot find an error message anywhere.  

        While a search that returns so many results with this plugin isn't a very useful search (who's going to page through 500 results?), if I can find out why this is happening I should be able to address the problem without the search dying.

        Any advice or suggestions would be greatly appreciated.

     

    Thanks!

  • I've not been able to test it with such a large amount of results, so cannot emulate what you are experiencing. Are you on a dedicated server or shared? If dedicated try and increase the memory allocation to any individual process and see if that helps (I'm guessing the server is out of memory on a large search).

    If this is the case then I'm thinking that a batch search would be better for the next version of the plugin.

    Let me know how you get on...

  • not having file search upto the mark yet. Also group searching is not available.Many aspects the plugin lags.

    But instead of having no working elgg default plugin this is much better!!!

    Sam.

  • Hey Jimbob!

    I'm having a problem with the following search results:

    Elgg Object: (Delete)

    With a popup "This entity cannot be displayed correctly..."

    Any idea why this is happening?

    Thanks!

  • Hello Jimbob,

    I have integrated your plugin and working great with the content search. But it is not doing a file search.....could you please let me know how to acheive it.

    Thanks!

Stats

  • Category: Tools
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 1984
  • Recommendations: 0

Other Projects

View jimbob's plugins