Я работаю с ElasticSearch 6.5.Я проиндексировал CSV-файл, используя следующий код:
def create_index(es_object, index_name):
created = False
# index settings
settings = {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0,
"analysis": {
"filter": {
"dbl_metaphone": {
"type": "phonetic",
"encoder": "beider_morse"
}
},
"analyzer": {
"dbl_metaphone": {
"tokenizer": "standard",
"filter": "beider_morse"
}
}
}
},
"mappings": {
"test": {
#"dynamic": "strict",
"properties": {
"family name": {
"type": "text",
"index": "analyzed",
"fields": {
"phonetic": {
"type": "string",
"analyzer": "dbl_metaphone"
}
}
},
"Firstname": {
"type": "text",
"index": "analyzed",
"fields": {
"phonetic": {
"type": "string",
"analyzer": "dbl_metaphone"
}
}
},
"Date of birth": {
"type": "text",
"index": "false"
},
"Place of birth": {
"type": "text",
"index": "false",
},
}
}
}
}
try:
if not es_object.indices.exists(index_name):
# Ignore 400 means to ignore "Index Already Exist" error.
es_object.indices.create(index=index_name, ignore=400, body=settings)
print('Created Index')
created = True
except Exception as ex:
print(str(ex))
finally:
return created
Проблема в том, что когда я пытался искать данные с помощью kibana, все поля были доступны для поиска и агрегирования.И я хотел исключить «Дата рождения» и «Место рождения» из доступных для поиска и агрегирования.
Может кто-нибудь объяснить, в чем проблема с моим отображением и как обновить индекс для его достижения?
Спасибо