Sha256: c436c83b6b409233fdfb834771ab2ee49f9b0de55e5ec14423fde7139eb57d78

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 KB

Contents

module ElasticsearchAutocomplete
  module Analyzers

    AC_TOKENIZERS = {
        ac_edge_ngram: {
            type: 'edgeNGram',
            min_gram: 1,
            max_gram: 50,
            side: 'front'
        },
        ac_edge_ngram_full: {
            type: 'nGram',
            min_gram: 1,
            max_gram: 50
        }
    }

    AC_FILTERS = {
        ac_edge_ngram: {
            type: 'edgeNGram',
            min_gram: 1,
            max_gram: 50,
            side: 'front'
        }
    }

    AC_ANALYZERS = {
        ac_edge_ngram: {
            type: 'custom',
            tokenizer: 'ac_edge_ngram',
            filter: %w(lowercase asciifolding)
        },
        ac_edge_ngram_full: {
            type: 'custom',
            tokenizer: 'ac_edge_ngram_full',
            filter: %w(lowercase asciifolding)
        },
        ac_edge_ngram_word: {
            type: 'custom',
            tokenizer: 'standard',
            filter: %w(lowercase asciifolding ac_edge_ngram)
        },
        ac_search: {
            type: 'custom',
            tokenizer: 'keyword',
            filter: %w(lowercase asciifolding)
        }
    }

    AC_BASE = {
        analysis: {
            analyzer: AC_ANALYZERS,
            tokenizer: AC_TOKENIZERS,
            filter: AC_FILTERS
        }
    }

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
elasticsearch_autocomplete-0.1.6 lib/elasticsearch_autocomplete/analyzers.rb
elasticsearch_autocomplete-0.1.5 lib/elasticsearch_autocomplete/analyzers.rb