skytteren / elasticala

A Scala API for Elasticsearch (in the making)

Version Matrix

elasticala

A Scala Client API for Elasticsearch (in the making)

THIS IS A SUBSET OF THE FULL ELASTICSEARCH CLIENT API.

I welcome pull requests.

Build Status

Why yet another Elasticsearch API for Scala?

The fun thing with this API is that types works all the way to the result. That is super helpful when working with a graph of aggregations.

So what does that mean?

Well, say the aggregation part of the query is a term query with a nested stats query like:

  • terms
    • stats

The result should be:

  • terms results
    • stats results

In all other clients the result needs to manually traversed based on names of the input. Here the is take care of by the compiler. The aggregation hierarchy is just as you want it to be. No more name lookups.

So what does it look like in actual use?

Here are examples of how it should work:

So is it ready for production?

No, it is hardly tested. This is currently a prototype to see if the scala compiler can be more "helpful" when working with Elasticsearch.

Getting started

Good luck!!! - You'll need it!

SBT:

libraryDependencies += "no.skytteren" % "elasticala_2.11" % "0.0.5"

Supported Features

Setup

  • Configuration
  • Upgrading
    • Rolling upgrades

Document APIs

  • Index API
  • Get API
  • Delete API
  • Update API
  • Multi Get API
  • Bulk API
  • Term Vectors
  • Multi termvectors API

Search APIs

Search

  • Request Body Search
    • Query
      • Match All Query
      • Full text queries
        • Match Query - some features missing
        • Multi Match Query - some features missing
        • Common Terms Query
        • Query String Query
        • Simple Query String Query
      • Term level queries
        • Term Query
        • Terms Query
        • Range Query
        • Exists Query
        • Missing Query
        • Prefix Query
        • Wildcard Query
        • Regexp Query
        • Fuzzy Query
        • Type Query
        • Ids Query
      • Compound queries
        • Constant Score Query
        • Bool Query
        • Dis Max Query
        • Function Score Query
        • Boosting Query
        • Indices Query
        • And Query - use bool query instead
        • Not Query - use bool query instead
        • Or Query - use bool query instead
        • Filtered Query - use bool query instead
        • Limit Query - use terminateAfter on search instead
      • Joining queries
        • Nested Query
        • Has Child Query
        • Has Parent Query
      • Geo queries
        • GeoShape Query
        • Geo Bounding Box Query
        • Geo Distance Query
        • Geo Distance Range Query
        • Geo Polygon Query
        • Geohash Cell Query
    • From / Size
    • Sort
    • Source filtering
    • Fields
    • Script Fields
    • Field Data Fields
    • Post filter
    • Highlighting
    • Rescoring
    • Search Type
    • Scroll
    • Preference
    • Explain
    • Version
    • Index Boost
    • min_score
    • Named Queries
    • Inner hits
  • Search Template
  • Search Shards API
  • Suggesters
    • Term suggester
    • Phrase Suggester
    • Completion Suggester
    • Context Suggester
  • Multi Search API
  • Count API
  • Search Exists API - deprecated: use search with size 0 and terminate_after 1
  • Validate API
  • Explain API
  • Percolator
  • Field stats API

Aggregations

  • Metrics Aggregations
    • Avg Aggregation
    • Cardinality Aggregation
    • Extended Stats Aggregation
    • Geo Bounds Aggregation
    • Max Aggregation
    • Min Aggregation
    • Percentiles Aggregation
    • Percentile Ranks Aggregation
    • Scripted Metric Aggregation
    • Stats Aggregation
    • Sum Aggregation
    • Top hits Aggregation
    • Value Count Aggregation
  • Bucket Aggregations
    • Children Aggregation
    • Date Histogram Aggregation
    • Date Range Aggregation
    • Filter Aggregation
    • Filters Aggregation
    • Geo Distance Aggregation
    • GeoHash grid Aggregation
    • Global Aggregation
    • Histogram Aggregation
    • IPv4 Range Aggregation
    • Missing Aggregation
    • Nested Aggregation
    • Range Aggregation
    • Reverse nested Aggregation
    • Sampler Aggregation
    • Significant Terms Aggregation
    • Terms Aggregation
  • Pipeline Aggregations
    • Avg Bucket Aggregation
    • Derivative Aggregation
    • Max Bucket Aggregation
    • Min Bucket Aggregation
    • Sum Bucket Aggregation
    • Moving Average Aggregation
    • Cumulative Sum Aggregation
    • Bucket Script Aggregation
    • Bucket Selector Aggregation
    • Serial Differencing Aggregation

Indices APIs

  • Create Index
  • Delete Index
  • Get Index
  • Indices Exists
  • Open / Close Index API
  • Mapping
    • Put Mapping
    • Get Mapping
    • Get Field Mapping
    • Datatypes
      • Field datatypes
      • Array datatype
      • Binary datatype
      • Boolean datatype
      • Date datatype
      • Geo-point datatype
      • Geo-Shape datatype
      • IPv4 datatype
      • Nested datatype
      • Numeric datatypes
      • Object datatype
      • String datatype
      • Token count datatype
    • Analysis
      • Analyzers
        • Standard Analyzer
        • Simple Analyzer
        • Whitespace Analyzer
        • Stop Analyzer
        • Keyword Analyzer
        • Pattern Analyzer
        • Language Analyzers
        • Snowball Analyzer
        • Custom Analyzer
      • Tokenizers
        • Standard Tokenizer
        • Edge NGram Tokenizer
        • Keyword Tokenizer
        • Letter Tokenizer
        • Lowercase Tokenizer
        • NGram Tokenizer
        • Whitespace Tokenizer
        • Pattern Tokenizer
        • UAX Email URL Tokenizer
        • Path Hierarchy Tokenizer
        • Classic Tokenizer
        • Thai Tokenizer
      • Token Filters
        • Standard Token Filter
        • ASCII Folding Token Filter
        • Length Token Filter
        • Lowercase Token Filter
        • Uppercase Token Filter
        • NGram Token Filter
        • Edge NGram Token Filter
        • Porter Stem Token Filter
        • Shingle Token Filter
        • Stop Token Filter
        • Word Delimiter Token Filter
        • Stemmer Token Filter
        • Stemmer Override Token Filter
        • Keyword Marker Token Filter
        • Keyword Repeat Token Filter
        • KStem Token Filter
        • Snowball Token Filter
        • Phonetic Token Filter
        • Synonym Token Filter
        • Compound Word Token Filter
        • Reverse Token Filter
        • Elision Token Filter
        • Truncate Token Filter
        • Unique Token Filter
        • Pattern Capture Token Filter
        • Pattern Replace Token Filter
        • Trim Token Filter
        • Limit Token Count Token Filter
        • Hunspell Token Filter
        • Common Grams Token Filter
        • Normalization Token Filter
        • CJK Width Token Filter
        • CJK Bigram Token Filter
        • Delimited Payload Token Filter
        • Keep Words Token Filter
        • Keep Types Token Filter
        • Classic Token Filter
        • Apostrophe Token Filter
      • Character Filters
        • Mapping Char Filter
        • HTML Strip Char Filter
        • Pattern Replace Char Filter
  • Types Exists
  • Index Aliases
  • Update Indices Settings
  • Get Settings
  • Analyze
  • Index Templates
  • Warmers
  • Shadow replica indices
  • Node level settings related to shadow replicas
  • Indices Stats
  • Indices Segments
  • Verbose mode
  • Indices Recovery
  • Indices Shard Stores
  • Clear Cache
  • Flush
  • Synced Flush
  • Refresh
  • Optimize
  • Upgrade

Cluster APIs

  • Cluster Health
  • Cluster State
  • Cluster Stats
  • Pending cluster tasks
  • Cluster Reroute
  • Cluster Update Settings
  • Nodes Stats
  • Nodes Info
  • Nodes hot_threads

Specialized queries

  • More Like This Query
  • Template Query
  • Script Query

Span queries

  • Span Term Query
  • Span Multi Term Query
  • Span First Query
  • Span Near Query
  • Span Or Query
  • Span Not Query
  • Span Containing Query
  • Span Within Query