<?xml version="1.0" encoding="UTF-8"?>
<indexer id="index.elasticsearch" enabled="false" label="CONF_MESSAGE[ElasticSearch Search Engine]" description="CONF_MESSAGE[ElasticSearch implementation to index all files and search a whole repository quickly.]"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
    <plugin_info>
        <core_relation packaged="true" tested_version="7.0"/>
    </plugin_info>

    <class_definition filename="plugins/index.elasticsearch/vendor/autoload.php" classname="Pydio\Access\Indexer\Implementation\ElasticSearchIndexer"/>
    <client_settings>
        <resources>
            <i18n namespace="index.elasticsearch" path="plugins/index.elasticsearch/resources/i18n" />
        </resources>
    </client_settings>
    <server_settings>
        <param name="ELASTICSEARCH_HOST" type="string" label="CONF_MESSAGE[ElasticSearch Host]" description="CONF_MESSAGE[ElasticSearch Server host (without http)]" mandatory="true" default="localhost"/>
        <param name="ELASTICSEARCH_PORT" type="integer" label="CONF_MESSAGE[ElasticSearch Port]" description="CONF_MESSAGE[ElasticSearch Server port (default 9200)]" mandatory="true" default="9200"/>
        <param name="index_content" type="boolean" label="CONF_MESSAGE[Index Content]" description="CONF_MESSAGE[Parses the file when possible and index its content (see plugin global options)]" mandatory="true" default="false"/>
        <param name="index_meta_fields" type="string" label="CONF_MESSAGE[Index Meta Fields]" description="CONF_MESSAGE[Which additionnal fields to index and search]" mandatory="false" default=""/>
        <param name="repository_specific_keywords" type="string" label="CONF_MESSAGE[Repository keywords]" description="CONF_MESSAGE[If your repository path is defined dynamically by specific keywords like AJXP_USER, or your own, mention them here.]" mandatory="false" default=""/>
        <global_param name="MAX_RESULTS" type="integer" label="CONF_MESSAGE[Max results displayed]" description="CONF_MESSAGE[Set the maximum results that will be displayed.]" mandatory="true" default="200"/>
        <global_param name="PARSE_CONTENT_MAX_SIZE" type="string" label="CONF_MESSAGE[Parse Content Until]" description="CONF_MESSAGE[Skip content parsing and indexation for files bigger than this size (must be in Bytes)]" mandatory="true" default="500000"/>
        <global_param name="PARSE_CONTENT_HTML" type="string" label="CONF_MESSAGE[HTML files]" description="CONF_MESSAGE[List of extensions to consider as HTML file and parse content]" mandatory="true" default="html,htm"/>
        <global_param name="PARSE_CONTENT_TXT" type="string" label="CONF_MESSAGE[Text files]" description="CONF_MESSAGE[List of extensions to consider as Text file and parse content]" mandatory="true" default="txt"/>
        <global_param name="UNOCONV" type="string" label="CONF_MESSAGE[Unoconv Path]" description="CONF_MESSAGE[Full path on the server to the 'unoconv' binary]" default="" mandatory="false"/>
        <global_param name="PDFTOTEXT" type="string" label="CONF_MESSAGE[PdftoText Path]" description="CONF_MESSAGE[Full path on the server to the 'pdftotext' binary]" default="" mandatory="false"/>
        <global_param name="AUTO_WILDCARD" type="boolean" label="CONF_MESSAGE[Auto-Wildcard]" description="CONF_MESSAGE[Automatically append a * after the user query to make the search broader]" default="false" mandatory="false"/>
        <global_param name="WILDCARD_LIMITATION" type="integer" label="CONF_MESSAGE[Wildcard limitation]" description="CONF_MESSAGE[For the sake of performances, it is not recommanded to use wildcard as a very first character of a query string. Lucene recommends asking the user minimum 3 characters before wildcard. Still, you can set it to 0 if necessary for your usecases.]" default="3" mandatory="false"/>
    </server_settings>
    <registry_contributions>
        <hooks>
            <serverCallback hookName="node.change" methodName="updateNodeIndex" defer="true"/>
            <serverCallback hookName="node.meta_change" methodName="updateNodeIndexMeta" defer="true"/>
            <serverCallback hookName="node.index.recursive.start" methodName="indexationStarts"/>
            <serverCallback hookName="node.index.recursive.end" methodName="indexationEnds"/>
            <serverCallback hookName="node.index" methodName="indexationIndexNode"/>
        </hooks>
        <actions>
            <action name="search">
                <rightsContext noUser="true" userLogged="only" read="true"
                               write="false" adminOnly="false">
                </rightsContext>
                <processing>
                    <serverCallback methodName="applyAction" restParams="/query/"/>
                </processing>
            </action>
            <action name="search_by_keyword">
                <rightsContext noUser="true" userLogged="only" read="true"
                               write="false" adminOnly="false">
                </rightsContext>
                <processing>
                    <serverCallback methodName="applyAction" restParams="/query/"/>
                </processing>
            </action>
        </actions>
        <client_configs>
            <component_config component="AjxpReactComponent::left_navigator">
                <additional_content
                        id="navigation_bookmarks"
                        position="1"
                        type="ListProvider"
                        options='{"title":"147", "titleClassName":"colorcode-bookmark", "fit":"content","silentLoading":true, "nodeProviderProperties":{"get_action":"search", "query":"keyword:ajxp_bookmarked"},"reloadOnServerMessage":"tree/reload_bookmarks", "connexion_discrete":true, "containerDroppableAction":"bookmark", "emptyChildrenMessage":515}'/>
            </component_config>
            <component_config component="AjxpReactComponent::left_navigator">
                <additional_content
                        id="navigation_shared"
                        position="2"
                        type="ListProvider"
                        options='{"title":"share_center.98", "titleClassName":"colorcode-shared", "fit":"content","silentLoading":true, "nodeProviderProperties":{"get_action":"search", "query":"keyword:ajxp_shared", "connexion_discrete":true}, "emptyChildrenMessage":"share_center.131","containerDroppableAction":"share-file-minisite","clearSelectionOnBlur":true,"reloadOnServerMessage":"tree/reload_shared_elements"}'/>
            </component_config>
        </client_configs>
    </registry_contributions>
    <dependencies>
        <!-- Stream Wrapper Access -->
        <activePlugin pluginName="access.AJXP_STREAM_PROVIDER"/>
    </dependencies>
</indexer>
