Skip to content

Commit

Permalink
Merge pull request #1 from nyaruka/index-tweaks
Browse files Browse the repository at this point in the history
tweaks to our indexes in support for search
  • Loading branch information
nicpottier authored Apr 5, 2018
2 parents 731425b + c69b399 commit 62e5787
Showing 1 changed file with 42 additions and 19 deletions.
61 changes: 42 additions & 19 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,18 +365,39 @@ const indexSettings = `
"type": "ngram",
"min_gram": 3,
"max_gram": 3
}
}
},
"analyzer": {
"trigrams": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"filter": [
"lowercase",
"trigrams_filter"
]
}
}
},
"locations": {
"tokenizer": "location_tokenizer",
"filter": [
"lowercase",
"word_delimiter"
]
}
},
"tokenizer": {
"location_tokenizer": {
"type": "pattern",
"pattern": "(.* > )?([^>]+)",
"group": 2
}
},
"normalizer": {
"lowercase": {
"type": "custom",
"char_filter": [],
"filter": ["lowercase"]
}
}
}
},
Expand All @@ -393,14 +414,9 @@ const indexSettings = `
"type": "keyword"
},
"text": {
"type": "text",
"analyzer": "simple",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 64
}
}
"type": "keyword",
"ignore_above": 64,
"normalizer": "lowercase"
},
"decimal": {
"type": "scaled_float",
Expand All @@ -410,13 +426,16 @@ const indexSettings = `
"type": "date"
},
"state": {
"type": "keyword"
"type": "text",
"analyzer": "locations"
},
"district": {
"type": "keyword"
"type": "text",
"analyzer": "locations"
},
"ward": {
"type": "keyword"
"type": "text",
"analyzer": "locations"
}
}
},
Expand All @@ -429,20 +448,23 @@ const indexSettings = `
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 64
"ignore_above": 64,
"normalizer": "lowercase"
}
}
},
"scheme": {
"type": "keyword"
"type": "keyword",
"normalizer": "lowercase"
}
}
},
"uuid": {
"type": "keyword"
},
"language": {
"type": "keyword"
"type": "keyword",
"normalizer": "lowercase"
},
"modified_on": {
"type": "date"
Expand All @@ -453,7 +475,8 @@ const indexSettings = `
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 64
"ignore_above": 64,
"normalizer": "lowercase"
}
}
}
Expand Down

0 comments on commit 62e5787

Please sign in to comment.