Created
August 7, 2019 19:23
-
-
Save neto-developer/5fb187c081890679007e481a33a827af to your computer and use it in GitHub Desktop.
ElasticSearch - Indice - Correção Ortografica
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Analyser: | |
https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-suggesters-phrase.html | |
Template: | |
POST /_template/template_produtos | |
{ | |
"index_patterns": [ | |
"produto*" | |
], | |
"settings": { | |
"number_of_shards": 1, | |
"analysis": { | |
"analyzer": { | |
"trigram": { | |
"type": "custom", | |
"tokenizer": "standard", | |
"filter": ["lowercase","shingle"] | |
}, | |
"reverse": { | |
"type": "custom", | |
"tokenizer": "standard", | |
"filter": ["lowercase","reverse"] | |
} | |
}, | |
"filter": { | |
"shingle": { | |
"type": "shingle", | |
"min_shingle_size": 2, | |
"max_shingle_size": 3 | |
} | |
} | |
} | |
}, | |
"mappings": { | |
"produto": { | |
"_source": { | |
"enabled": true | |
}, | |
"properties": { | |
"produtoDerivacao.id": { | |
"type": "long" | |
}, | |
"produtoDerivacao.tituloCompleto": { | |
"type": "text", | |
"analyzer": "brazilian", | |
"fields": { | |
"trigram": { | |
"type": "text", | |
"analyzer": "trigram" | |
}, | |
"reverse": { | |
"type": "text", | |
"analyzer": "reverse" | |
} | |
} | |
}, | |
"produtoDerivacao.sku": { | |
"type": "text" | |
}, | |
"produtoDerivacao.ean": { | |
"type": "text" | |
}, | |
"produtoDerivacao.modelo": { | |
"type": "keyword" | |
}, | |
"categoria_principal": { | |
"type": "text", | |
"analyzer": "brazilian" | |
}, | |
"produtoDerivacao.produto.marca.nome": { | |
"type": "keyword" | |
}, | |
"produtoDerivacao.numVendas": { | |
"type": "float" | |
}, | |
"numAcessos": { | |
"type": "integer" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment