Update ES index creation and population scripts

This commit is contained in:
DariusIII
2020-01-04 01:47:52 +01:00
parent 1b40e5e343
commit 44ebc489ea
2 changed files with 38 additions and 2 deletions
+38
View File
@@ -12,6 +12,25 @@ $releases_index = [
'number_of_shards' => 2,
'number_of_replicas' => 0,
],
'mappings' => [
'properties' => [
'id' => [
'type' => 'long',
'index' => false
],
'name' => ['type' => 'text'],
'searchname' => [
'type' => 'text',
'fields' => [
'sort' => [
'type' => 'keyword'
]
]
],
'fromname' => ['type' => 'text'],
'filename' => ['type' => 'text'],
]
]
],
];
@@ -28,7 +47,26 @@ $predb_index = [
'number_of_shards' => 2,
'number_of_replicas' => 0,
],
'mappings' => [
'properties' => [
'id' => [
'type' => 'long',
'index' => false
],
'title' => [
'type' => 'text',
'fields' => [
'sort' => [
'type' => 'keyword'
]
]
],
'filename' => ['type' => 'text'],
'source' => ['type' => 'text'],
]
]
],
];
$response = \Elasticsearch::indices()->create($predb_index);
@@ -73,7 +73,6 @@ function populate_indexes($table, $max)
$data['body'][] = [
'index' => [
'_index' => 'releases',
'_type' => 'releases',
'_id' => $row->id,
],
];
@@ -91,7 +90,6 @@ function populate_indexes($table, $max)
$data['body'][] = [
'index' => [
'_index' => 'predb',
'_type' => 'predb',
'_id' => $row->id,
],
];