You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 26, 2024. It is now read-only.
Vue Storefront gets it's all data from [vue-storefront-api](https://github.com/DivanteLtd/vue-storefront-api) endpoints, operating on top of Elastic Search data store.
3
+
Vue Storefront gets all its data from [vue-storefront-api](https://github.com/DivanteLtd/vue-storefront-api) endpoints, operating on top of Elastic Search data store.
4
+
5
+
If you installed the project using `npm run installer` command then, the database has been set up, data imported from demo-dump and everything should be just fine.
4
6
5
-
If You installed the project using `npm run installer` command then, the database has been set up, data imported from demo-dump and everything should be just fine.
6
7
After some more extensive data operations - like custom imports using [mage2vuestorefront](https://github.com/DivanteLtd/mage2vuestorefront) or [magento1-vsbridge](https://github.com/DivanteLtd/magento1-vsbridge) there is a need to re-index the ElasticSearch and setup the proper metadata for fields.
7
8
8
-
The main reason You know You must reindex the database is kind of the following error You get from vue-storefront console:
9
+
The main reason you know you must reindex the database is kind of the following error you get from the `vue-storefront` console:
9
10
10
11
```json
11
12
Error: {"root_cause":[{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [created_at] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"vue_storefront_catalog_1521776807","node":"xIOeZW2lTwaprGXh6YLyCA","reason":{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [created_at] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."}}]}
12
13
```
13
14
14
15
In this case there is a db tool inside your local `vue-storefront-api` installation to the rescue.
15
16
16
-
## Re-indexing existing database
17
+
## Re-indexing an existing database
17
18
18
19
Please go to `vue-storefront-api` directory and run:
19
-
`npm run db rebuild`
20
+
21
+
```bash
22
+
npm run db rebuild`
23
+
```
20
24
21
25
This command will:
22
26
23
27
- reindex your currently set (in the `config/local.json` config file) elastic search index to temp-one,
24
28
- put the right elastic search mappings on top of the temp index,
25
29
- drop the original index,
26
-
- create the alias with original name to the temp one - so You can use original name without any reference chcanges.
30
+
- create the alias with original name to the temp one - so You can use original name without any reference changes.
27
31
28
32
You can specify different (than this setin`config/local.json`) index name by running:
29
-
`npm run db rebuild -- --indexName=custom_index_name`
33
+
34
+
```bash
35
+
npm run db rebuild -- --indexName=custom_index_name
36
+
```
30
37
31
38
## Creating the new index
32
39
33
40
If you like to create new, empty index please run:
34
-
`npm run db new`
41
+
42
+
```bash
43
+
npm run db new
44
+
```
35
45
36
46
This tool will drop your current index and create new, empty one with all the metafields set.
37
47
38
48
You can specify different (than this setin`config/local.json`) index name by running:
39
-
`npm run db rebuild -- --indexName=custom_index_name`
40
49
41
-
## Chaning the index structure / adding new fields / chaning the types
50
+
```bash
51
+
npm run db rebuild -- --indexName=custom_index_name
52
+
```
53
+
54
+
## Changing the index structure / adding new fields / changing the types
42
55
43
-
If You like to extenend the ElasticSearch data structures or map some particular field types. For example after getting kind of this error:
56
+
If you like to extend the ElasticSearch data structures or map some particular field types, for example after getting kind of this error:
44
57
45
58
```
46
59
[{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [created_at] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."}]
@@ -52,7 +65,10 @@ Please do change the ES schema by modifying:
0 commit comments