Using ElasticSearch as a fast, flexible, and scalable solution to search occurrence records and checklists
1. Using ElasticSearch as a fast, flexible,
and scalable solution to search
occurrence records and checklists
Christian Gendreau, Canadensys
Marie-Elise Lecoq, GBIF France
2. Introduction
ElasticSearch is an open source, document oriented, distributed
search engine, built on top of Apache Lucene.
From ElasticSearch GitHub page
9. Our ElasticSearch index
Index structure for scientific names
• autocompletion : edge_ngram filter
o
“carex” -> “ca”,”car”,”care”,”carex”
• genus first letter : pattern_replace filter
o
“carex feta” -> “c. feta”
• epithet : path_hierarchy tokenizer
o
“carex feta” -> “feta”
10. ElasticSearch at GBIF France
Data stored in ElasticSearch are updated upon MongoDB
changes.
The search engine requests elasticsearch using filters like taxon,
date, place, dataset and geolocalisation.
Statistic calculation using facets
12. ElasticSearch - Solr
• Solr and elasticsearch both tries to solve the same problem
with no much differences
• Development setup and production deployment (replication /
sharding) easier with elasticsearch
• By default, the elasticsearch is well configured for Lucene and
customization remains easy.
13. Facets
• “Group by” in SQL
• Mostly used for calculate statistics
• Example :
curl -XGET [...]
"facets" : {
”dataset" : {
"terms" : {
"field" : ”dataset",
"order" : "term”
…
14. API and libraries
REST API
o interoperability between different programming languages
o HTTP request
Java API
o
o
more efficient than REST API due to the binary API use.
built in marshaling(data formatting on the network)
17. Pitfalls
•
•
•
•
Error reporting (index creation, river creation)
Results may be hard to predict using complex queries
Documentation
With each mapping modification comes a free reindex from
data