DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:elasticsearch

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:elasticsearch [2021-06-08 23:50] – version upped andiplugin:elasticsearch [2024-02-15 12:01] (current) Aleksandr
Line 2: Line 2:
  
 ---- plugin ---- ---- plugin ----
-description: Integrate Elasticsearch engine+description: Integrate an external Elasticsearch engine into DokuWiki
 author     : Andreas Gohr, Anna Dabrowska  author     : Andreas Gohr, Anna Dabrowska 
 email      : dokuwiki@cosmocode.de  email      : dokuwiki@cosmocode.de 
-type       : action +type       : action, cli 
-lastupdate : 2021-06-07 +lastupdate : 2023-12-20 
-compatible : Greebo, Hogfather+compatible : Greebo, Hogfather, Igor, Jack Jackrum, Kaos
 depends    :  depends    : 
 conflicts  conflicts 
-similar    : +similar    : docsearch, searchtext
 tags       : search tags       : search
  
Line 23: Line 23:
 ===== Installation ===== ===== Installation =====
  
-[[https://www.cosmocode.de/en/open-source/dokuwiki-plugins/|{{ http://cosmocode.de/static/img/dokuwiki/dwplugins.png?recache|A CosmoCode Plugin}}]]+[[https://www.cosmocode.de/en/open-source/dokuwiki-plugins/|{{ https://www.cosmocode.de/static/img/dokuwiki/dwplugins.png?recache|A CosmoCode Plugin}}]]
  
 :!: **External requirements:** This plugin requires the following additional components that must be installed separately:  :!: **External requirements:** This plugin requires the following additional components that must be installed separately: 
-  * [[https://www.elastic.co/products/elasticsearch|Elasticsearch]] instance (latest supported version 7.11)+  * [[https://www.elastic.co/products/elasticsearch|Elasticsearch]] instance (latest tested version 8.11)
  
-Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually.+Download and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
 Configure and setup the plugin as outlined under [[#Configuration]] below. Configure and setup the plugin as outlined under [[#Configuration]] below.
Line 34: Line 34:
 ===== Examples/Usage ===== ===== Examples/Usage =====
  
-Once installed, the plugin will automatically react on the ?do=search action, replacing DokuWiki's builtin search. +Once installed, the plugin will automatically react on the ?do=search action, replacing DokuWiki's builtin search. However, the typical DokuWiki query shortcuts (like @namespace) **do not** work in ElasticSearch.
  
 All [[acl|access rights]] are respected, so users will only find pages for which they have at least read privileges. All [[acl|access rights]] are respected, so users will only find pages for which they have at least read privileges.
  
-You can use the Advanced Search Tools to filter the results by namespace and date of the last modification.+You can use the Advanced Search Tools to filter the results by namespace and date of the last modification. With [[plugin:tagging|tagging plugin]] installed, the search tools will include a dropdown with tags available for the current result set. So if none of the current results are tagged, the filter will not be displayed.
  
 If the [[plugin:text|text plugin]] is installed, the rendered content of pages will be indexed in addition to raw wiki syntax. By default, search uses both fields. If you want to disable search in syntax, change the ''searchSyntax'' setting in the plugin's configuration. If the [[plugin:text|text plugin]] is installed, the rendered content of pages will be indexed in addition to raw wiki syntax. By default, search uses both fields. If you want to disable search in syntax, change the ''searchSyntax'' setting in the plugin's configuration.
 +
 ===== Configuration and Settings ===== ===== Configuration and Settings =====
  
Line 46: Line 47:
  
   - enter the configuration of your Elasticsearch server in the [[plugin:config|Configuration Settings]]   - enter the configuration of your Elasticsearch server in the [[plugin:config|Configuration Settings]]
 +  - optional: if your ES instance has security enabled (default setting since 8.0), enter the authentication username and password in [[plugin:config|Configuration Settings]]
 +  - copy and adjust a sample configuration for media indexing
   - create the Index   - create the Index
-  - create the Language Mappings 
   - index your pages   - index your pages
  
 ==== Creating the Index ==== ==== Creating the Index ====
 +
 +==== Indexing media ====
 +
 +Copy the ''elasticsearch.conf.example'' included in this plugin's conf directory into ''/conf/elasticsearch.conf''. The defaults should be fine for typical Linux servers. They include some popular file extensions and point to tools for extracting text from them, either as UNIX commands or a URL of a public Apache Tika server.
  
 You can use the tools provided by ElasticSearch to create the index or simply run the provided command line tool to do so: You can use the tools provided by ElasticSearch to create the index or simply run the provided command line tool to do so:
Line 67: Line 73:
 ./bin/plugin.php elasticsearch createindex --clear ./bin/plugin.php elasticsearch createindex --clear
 </code> </code>
-==== Languages and fuzzy search ==== 
  
-One of the main reasons for using a dedicated search engine is that it provides advanced features, such as fuzzy search. To enable it, the pages must be indexed using a linguistic analyzer in the appropriate language. Make sure to create the language mapping using the CLI tool **before** filling the index.+:!: Make sure to re-create your index after upgrading the plugin to 2022-11-02. This will update index structure and index your media.
  
-<code> +==== Languages and fuzzy search ==== 
-./bin/plugin.php elasticsearch createlangmapping + 
-</code>+One of the main reasons for using a dedicated search engine is that it provides advanced features, such as fuzzy search.
  
-If you have configured multiple languages using the [[plugin:translation|Translation plugin]], they will be mapped as well.+If you have configured multiple languages using the [[plugin:translation|Translation plugin]], they will be recognized.
  
 By default all available translation are searched. Users can change the language selection in Advanced Search Tools. By default all available translation are searched. Users can change the language selection in Advanced Search Tools.
Line 90: Line 95:
 ./bin/plugin.php elasticsearch index ./bin/plugin.php elasticsearch index
 </code> </code>
 +
 +You can index pages or media separately:
 +
 +<code>
 +./bin/plugin.php elasticsearch index --only=pages
 +./bin/plugin.php elasticsearch index --only=media
 +</code>
 +
  
 ===== Other plugins ===== ===== Other plugins =====
Line 118: Line 131:
   * search a specific language   * search a specific language
   * exact match (non-fuzzy search)   * exact match (non-fuzzy search)
- 
  
plugin/elasticsearch.1623189029.txt.gz · Last modified: 2021-06-08 23:50 by andi

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki