Skip to content

Instantly share code, notes, and snippets.

@hosuaby
Created January 10, 2020 12:51
Show Gist options
  • Save hosuaby/dba9f1b95c1f9771e870db5e4c7e1c52 to your computer and use it in GitHub Desktop.
Save hosuaby/dba9f1b95c1f9771e870db5e4c7e1c52 to your computer and use it in GitHub Desktop.
Idea of DSL for Elasticsearch mappings
pattern_replace removeNonWordExceptComa [[^\p{IsAlphabetic}]&&\D&&[^,]&&\S] -> ""
pattern_replace pseudoElisionHack65Synonyms {
pattern (\b[a-zA-Z]\')
replacement ""
}
index a2_onecarrefour_instore_20200108_143341 {
type product
settings {
number_of_shards 1
number_of_replicas 1
refresh_interval 60s
}
all keyword * {
ignore_above 256
}
keyword Titre
keyword facet_enseignes {
text sort {
fielddata true
analysis {
tokenizer keyword
char_filter [
removeNonWordExceptComa
pseudoElisionHack65Synonyms
]
filter [
lowercase
asciifolding
pattern_replace [^\\w] -> ""
]
}
}
}
object availability {
keyword real_availability
object slice_available {
boolean 1A AB 2A 2B
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment