Skip to content

Instantly share code, notes, and snippets.

@frague59
Created February 1, 2016 09:55
Show Gist options
  • Save frague59/eddc0c9446809ba0c917 to your computer and use it in GitHub Desktop.
Save frague59/eddc0c9446809ba0c917 to your computer and use it in GitHub Desktop.
elasticsearch_index_settings
ELASTICSEARCH_INDEX_SETTINGS = {
'settings': {
'index': {
'number_of_shards': 6,
'analysis': {
'tokenizer': {
'haystack_ngram_tokenizer': {
'type': 'nGram',
'min_gram': 3,
'max_gram': 15,
},
'haystack_edgengram_tokenizer': {
'type': 'edgeNGram',
'min_gram': 2,
'max_gram': 15,
'side': 'front'
}
},
'analyzer': {
'ngram_analyzer': {
'type': 'custom',
'tokenizer': 'standard',
'filter': ['haystack_ngram',
'lowercase']},
'edgengram_analyzer': {
'type': 'custom',
'tokenizer': 'standard',
'filter': ['haystack_edgengram', 'lowercase']},
},
'filter': {
'haystack_ngram': {
'type': 'nGram',
'min_gram': 3,
'max_gram': 15},
'haystack_edgengram': {
'type': 'edgeNGram',
'min_gram': 2,
'max_gram': 15}
},
},
'mappings': {
'document_file': {
'properties': {
'type': 'attachment',
'fields': {
'content': {
'store': True,
'type': 'string',
'term_vector': 'with_position_offset'},
'title': {'store': True},
'date': {'store': True},
'author': {'store': True},
'keywords': {'store': True},
'content_type': {'store': True},
'content_length': {'store': True},
'language': {'store': True}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment