2017 © Pedro Peláez
 

elgg-plugin elgg_solr

Basic solr integration to replace elgg search

image

arckinteractive/elgg_solr

Basic solr integration to replace elgg search

  • Sunday, April 22, 2018
  • by beck24
  • Repository
  • 8 Watchers
  • 7 Stars
  • 285 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 1 Open issues
  • 36 Versions
  • 1 % Grown

The README.md

elgg_solr

Speed up site search by using a dedicated Solr search index, (*1)

  • Search Entities
  • Search tags (exact match)
  • Search File contents

This plugin follows the structure of the default Elgg search plugin, can be extended using the same search plugin hooks., (*2)

Dependencies

  • This plugin depends on the default elgg search plugin (bundled with Elgg)
  • This plugin depends on the vroom plugin - https://github.com/jumbojett/vroom

Installation

  1. Download the plugin and upload it to /mod/elgg_solr, or install with composer composer require arckinteractive/elgg_solr:~2.0, (*3)

  2. In Admin > Plugins, reorder the elgg_solr plugin to be positioned under search plugin, and enable it, (*4)

  3. Create a new Solr instance and configure it:, (*5)

    • Make sure that /<instance>/conf/solrconfig.xml is set to use classic index schema: <schemaFactory class="ClassicIndexSchemaFactory"></schemaFactory>
    • Copy contents of install/schema.xml (or install/schema.solr5.xml for Solr 5+) included in the root of the plugin to /<instance>/conf/schema.xml
      • Copy contents of install/solrconfig.solr5.xml to `//conf/solrconfig.xml if using solr 5
  4. Update elgg_solr plugin settings to point to the new Solr instance, (*6)

  5. Trigger a reindex from the plugin setting page, (*7)

  6. Ensure that daily cron is configured and active, (*8)

Plugin hooks

search, <search_type>, (*9)

search, <entity_type>, (*10)

search, <entity_type>:<entity_subtype>, (*11)

These hooks can be used to modify search criteria, (*12)

elgg_solr:index, <entity_type>, (*13)

elgg_solr:index, <entity_type>:<entity_subtype>, (*14)

elgg_solr:index, annotation, (*15)

These hooks can be used to customize indexed fields, (*16)

elgg_solr:can_index, annotation, (*17)

Allows to add annotations to index by name, (*18)

elgg_solr:access, entities, (*19)

Allows plugins to add additional access queries., (*20)

Indexing

Tuning indexed values

Indexed values can be customized using 'elgg_solr:index',<entity_type>' hook:, (*21)

elgg_register_plugin_hook_handler('elgg_solr:index', 'object', function($hook, $type, $return, $params) {

    $entity = elgg_extract('entity', $params);
    if (!$entity instanceof Event) {
        return;
    }

    $return->custom_field_s = $entity->custom_field;
    $return->start_time_i = $entity->start_time;
    return $return;
});

Adding annotations to index

To add an annotation to the index, add annotation name to the return of the 'elgg_solr:can_index','annotation':, (*22)

elgg_register_plugin_hook_handler('elgg_solr:can_index', 'annotation', function($hook, $type, $return) {
    $return[] = 'revision';
    return $return;
});

Indexed values

Entity

  • id - guid
  • type - entity type
  • subtype - entity subtype
  • owner_guid - guid of the owner
  • container_guid - guid of the container
  • access_id - access level
  • title - title
  • name - name
  • description - description
  • time_created - timestamp of the creation
  • time_updated_i - timestamp of the last update
  • enabled - is entity enabled
  • tag_<tag_name>_ss - tags for registered tag metadata names
  • has_pic_b - flag indicating that entity has an uploaded icon
  • responses_thread_i - guid of the comment/reply thread root
  • responses_is - guids of comments/replies
  • responses_count_i - total count of comments/replies
  • likes_count_i - total count of likes

User

In addition to Entity fields:, (*23)

  • username - username
  • profile_<field_name>_s - profile fields with a single value
  • profile_<field_name>_ss - profile fields with multiple values (tags)
  • groups_is - guids of groups a user is member of
  • groups_count_i - total number of groups a user is a member of
  • friends_is - guids of user's friends
  • friends_count_i - total number of friends
  • last_login_i - timestamp of the last login
  • last_action_i - timestamp of the last activity
  • has_pic_b - flag indicating that user has an avatar

Group

In addition to Entity fields:, (*24)

  • group_<field_name>_s - profile fields with a single value
  • group_<field_name>_ss - profile fields with multiple values (tags)
  • members_is - guids of group members
  • members_count_i - total number of group members

File

To index file contents, enable extraction (extract_handler) in plugin settings., (*25)

In addition to Entity fields:, (*26)

  • attr_content - extracted contents
  • simpletype_s - simple type (e.g. image, document etc)
  • mimetype_s - detected mime type (e.g. application/json)
  • originalfilename_s - original name of the uploaded file
  • filesize_i - file size in bytes

The Versions

22/04 2018

dev-elgg3

dev-elgg3 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0-only

The Requires

 

by Matt Beckett
by Billy Gunn

plugin search scalability solr elgg

05/04 2018

1.11.x-dev

1.11.9999999.9999999-dev http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0-only

The Requires

 

by Billy Gunn

plugin search scalability solr elgg

05/04 2018

1.11.1

1.11.1.0 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0-only

The Requires

 

by Billy Gunn

plugin search scalability solr elgg

05/04 2018

dev-master

9999999-dev http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0 GPL-2.0-only

The Requires

 

by Matt Beckett
by Billy Gunn

plugin search scalability solr elgg

05/04 2018

2.2.8

2.2.8.0 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0-only

The Requires

 

by Matt Beckett
by Billy Gunn

plugin search scalability solr elgg

05/04 2018

1.11.0

1.11.0.0 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0

The Requires

 

by Billy Gunn

plugin search scalability solr elgg

03/02 2018

2.2.7

2.2.7.0 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0-only

The Requires

 

by Matt Beckett
by Billy Gunn

plugin search scalability solr elgg

25/11 2017

2.2.6

2.2.6.0 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0

The Requires

 

by Matt Beckett
by Billy Gunn

plugin search scalability solr elgg

25/11 2017

2.2.5

2.2.5.0 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0

The Requires

 

by Matt Beckett
by Billy Gunn

plugin search scalability solr elgg

10/05 2017

2.2.4

2.2.4.0 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0

The Requires

 

by Matt Beckett
by Billy Gunn

plugin search scalability solr elgg

12/03 2017

2.2.3

2.2.3.0 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0

The Requires

 

by Matt Beckett
by Billy Gunn

plugin search scalability solr elgg

22/02 2017

2.2.2

2.2.2.0 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0

The Requires

 

by Matt Beckett
by Billy Gunn

plugin search scalability solr elgg

22/02 2017

2.2.1

2.2.1.0 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0

The Requires

 

by Matt Beckett
by Billy Gunn

plugin search scalability solr elgg

22/02 2017

2.1.3

2.1.3.0 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0

The Requires

 

by Matt Beckett
by Billy Gunn

plugin search scalability solr elgg

10/09 2016

2.1.2

2.1.2.0 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0

The Requires

 

by Matt Beckett
by Billy Gunn

plugin search scalability solr elgg

10/09 2016

1.10.x-dev

1.10.9999999.9999999-dev http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0

The Requires

 

by Billy Gunn

plugin search scalability solr elgg

22/05 2016

2.1.0

2.1.0.0 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0

The Requires

 

by Billy Gunn

plugin search scalability solr elgg

09/04 2016

2.0.1

2.0.1.0 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0

The Requires

 

by Billy Gunn

plugin search scalability solr elgg

08/04 2016

2.0.0

2.0.0.0 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0

The Requires

 

by Billy Gunn

plugin search scalability solr elgg

08/04 2016

1.10.1

1.10.1.0 http://arckinteractive.com

Basic solr integration to replace elgg search

  Sources   Download

GPL-2.0

The Requires

 

by Billy Gunn

plugin search scalability solr elgg

13/08 2015
10/08 2015
07/08 2015
16/05 2015
15/05 2015
14/05 2015
31/03 2015
15/03 2015

1.8.1

1.8.1.0

  Sources   Download

The Requires

 

18/12 2014

1.7.1

1.7.1.0

  Sources   Download

The Requires

 

11/12 2014

1.7

1.7.0.0

  Sources   Download

The Requires

 

17/06 2014

1.5.1

1.5.1.0

  Sources   Download

The Requires

 

10/05 2014

1.5

1.5.0.0

  Sources   Download

The Requires

 

08/05 2014

1.4.1

1.4.1.0

  Sources   Download

The Requires

 

05/05 2014

1.4

1.4.0.0

  Sources   Download

The Requires

 

03/05 2014

1.3

1.3.0.0

  Sources   Download

The Requires

 

28/04 2014

1.2.1

1.2.1.0

  Sources   Download

The Requires