ElasticSearch Toolbox for ArcGIS

what's new

Introduction

ElasticSearch is a great opensource Search Engine, all datas are stored in indices and search with a very fast response time, giving a "all data accessible" experience.

This toolbox providing a full admin experience without coding, to manage ElasticSearch from ArcCatalog, and integrate Models for automation.

This is composed of a set of tools for creating the indices, specify options for data indexing and analysis.

5 mins Startup with the toolbox

You must have an ElasticSearch server up and running, if not the case, you can go to this website http://www.elasticsearch.org/

Insert datas in an index

Import function insert FeatureClass data in a newly created index, using directly the import function, it will use the defaults elastic parameters on indexing. Thoses parameters can be override giving an analyzer file and mapping file (for extended search, ie : phonetic, stopwords, pattern decomposition).

Query the datas

Without any client GUI, once the index is created, you can query the data directly using a browser, and test the index relevance.

a full documentation of the simple URI query API is available here at ElasticSearch .

Rational

Concepts

The toolbox permit to integrate a FeatureClass to the Index, all the records are indexed using the objectif as the key. Geometry is pushed using the JSON format for a later use.

Elastic Search can handle multiple named indices. Each index can have multiple "index type" containing different datasets but sharing the same analyzers or tokenizer.

Analyzers

Analyzers in Elastic Search define the way the datas are inserted in the index. Analyzers are using a tokenizer for splitting the value into tokens. Tokens can be adjusted thank's to filters for enhance the search.

an analyzer file is formatted as elastic search input :

{  
"filter" : {
    "synonym_adresse" : {
        "type" : "synonym",
        "synonyms" : [
            "r,rue =rue",
            "ch, che =chemin",
            "av, ave =avenue"
            ]
    },
    "adresse":{
        "type" : "snowball",
        "language" : "French"
    },
    "phonetic" : {
        "type" : "phonetic",
        "encoder" : "bm",
        "languageset":["french"],
        "replace" : false
    },
    "stopfilter" : {
        "type" : "stop",
        "stopwords":["_french_"]
    },
    "elision" : {
        "type" : "elision",
        "articles" : ["l", "m", "t", "qu", "n", "s", "j", "d"]
    }



},

"tokenizer" : {

    "ngram" : {
        "type" : "edgeNGram",
        "max_gram" : 20
    }
},

"analyzer" : {
    "default" : {
        "tokenizer" : "standard", 
        "filter" : ["asciifolding","lowercase"]
    },
    "adresse":{
        "tokenizer" : "standard",
        "filter":["standard","lowercase","synonym_adresse","stopfilter","elision","phonetic"]
    }
}
}

The toolbox provide a way to easily push specific analyzers definitions on an index.

the following screenshot show how to create a new index and attach the analyzers on this index.

Once the analyzer has been push, using the browser it is possible to check the token decomposition on an input, using the /_analyze url

Mapping

Mapping file specify how the fields will be indexed in Elastic Search and all the parameters associated to.

The Create Mapping Tool create a first draft of the field mapping. This file can then be edited with a text editor to add more Elastic Search capabilities.

the output is formatted as followed and can be completed :

{
"mappings":{
    "adr":{
        "properties":{
            "gcd_num":{
                "index":"analyzed",
                    "type":"integer",
                    "name":"gcd_num",
                    "store":"yes"
            },
                "gcd_name":{
                    "index":"analyzed",
                    "type":"string",
                    "name":"gcd_name",
                    "store":"yes"
                },
                "locality":{
                    "index":"analyzed",
                    "name":"locality",
                    "search_analyzer":"adresse",
                    "index_analyzer":"adresse",
                    "type":"string",
                    "store":"yes"
                },
                "gcd_nomrue":{
                    "index":"analyzed",
                    "name":"gcd_nomrue",
                    "search_analyzer":"adresse",
                    "index_analyzer":"adresse",
                    "type":"string",
                    "store":"yes"
                },
                "shape@json":{
                    "index":"no",
                    "index_in_all":"no",
                    "type":"string",
                    "name":"shape@json",
                    "store":"yes"
                },
                "depadmin":{
                    "index":"analyzed",
                    "type":"string",
                    "name":"depadmin",
                    "store":"yes"
                },
                "gcd_cp":{
                    "index":"analyzed",
                    "type":"string",
                    "name":"gcd_cp",
                    "store":"yes"
                }
        },
            "_source":{
                "enabled":true
            }
    }
},
    "settings":{
        "index":{
            "analysis":{
                "filter":{
                    "adresse":{
                        "type":"snowball",
                        "language":"French"
                    },
                    "synonym_adresse":{
                        "synonyms":[
                            "r,rue => rue",
                        "ch, che => chemin"
                            ],
                        "type":"synonym"
                    }
                },
                "analyzer":{
                    "adresse":{
                        "filter":[
                            "standard",
                        "lowercase",
                        "synonym_adresse",
                        "adresse"
                            ],
                        "tokenizer":"standard"
                    }
                }
            }
        }
    }
}

once edited, a tool send the mapping to the elastic search indexType:

The Toolbox

Client side

Multiple components can then be use or developed to integrate the search in an application.

Integration with the WebAppBuilder

an integration has been done in webappbuilder, providing a search capability for all interest objects.

a demo at this link show a live video - Live Video

References