Skip to content

Commit

Permalink
tweaks to our indexes in support for search
Browse files Browse the repository at this point in the history
  • Loading branch information
nicpottier committed Apr 5, 2018
1 parent 731425b commit 06eb0fe
Showing 1 changed file with 41 additions and 19 deletions.
60 changes: 41 additions & 19 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,18 +365,38 @@ 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"
]
}
},
"tokenizer": {
"location_tokenizer": {
"type": "pattern",
"pattern": "(.* > )?([^>]+)",
"group": 2
}
},
"normalizer": {
"lowercase": {
"type": "custom",
"char_filter": [],
"filter": ["lowercase"]
}
}
}
},
Expand All @@ -393,14 +413,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 +425,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 +447,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 +474,8 @@ const indexSettings = `
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 64
"ignore_above": 64,
"normalizer": "lowercase"
}
}
}
Expand Down

0 comments on commit 06eb0fe

Please sign in to comment.