nextcloud / fulltextsearch_elasticsearch

🔍 Use Elasticsearch to index the content of your Nextcloud
https://apps.nextcloud.com/apps/fulltextsearch_elasticsearch
GNU Affero General Public License v3.0
81 stars 30 forks source link

Allow configuring document type #115

Closed Dalvany closed 3 years ago

Dalvany commented 4 years ago

Hello, I'm using an elasticsearch 7.8.0 and when I tried indexing files I get this error :

┌─ Errors ────
│ Error:    102/102
│ Index: files:14728
│ Exception: Elasticsearch\Common\Exceptions\BadRequest400Exception
│ Message: Rejecting mapping update to [nextcloud] as the final mapping would
│ have more than 1 type: [_doc, standard]
│
└──

As multiple types are no longer supported and support while be completly removed in the futur (see https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html) it would be nice allowing using a custom value as type so user of elastic 7.8 can change it to _doc.

Dalvany commented 4 years ago

A few logs from elastic when executing fulltextsearch:test

elasticsearch_1  | {"type": "server", "timestamp": "2020-07-24T20:09:36,478Z", "level": "INFO", "component": "o.e.c.r.a.AllocationService", "cluster.name": "elastic", "node.name": "elastic-1", "message": "Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[nextcloud][0]]]).", "cluster.uuid": "Gdf_wnfpRHCbf5zf4IRCcw", "node.id": "0K1Vo0RlStKkgTPhDRa4Bg"  }
elasticsearch_1  | {"type": "server", "timestamp": "2020-07-24T20:09:37,103Z", "level": "DEBUG", "component": "o.e.a.a.i.m.p.TransportPutMappingAction", "cluster.name": "elastic", "node.name": "elastic-1", "message": "failed to put mappings on indices [[[nextcloud/WB3AwZegSciCXbWx8vNX5g]]], type [standard]", "cluster.uuid": "Gdf_wnfpRHCbf5zf4IRCcw", "node.id": "0K1Vo0RlStKkgTPhDRa4Bg" ,
elasticsearch_1  | "stacktrace": ["java.lang.IllegalArgumentException: Rejecting mapping update to [nextcloud] as the final mapping would have more than 1 type: [_doc, standard]",
elasticsearch_1  | "at org.elasticsearch.cluster.metadata.MetadataMappingService$PutMappingExecutor.applyRequest(MetadataMappingService.java:273) ~[elasticsearch-7.8.0.jar:7.8.0]",
[...]
elasticsearch_1  | {"type": "server", "timestamp": "2020-07-24T20:09:37,117Z", "level": "DEBUG", "component": "o.e.a.b.TransportShardBulkAction", "cluster.name": "elastic", "node.name": "elastic-1", "message": "[nextcloud][0] failed to execute bulk item (index) index {[nextcloud][standard][test_provider:license], source[n/a, actual length: [32.5kb], max length: 2kb]}", "cluster.uuid": "Gdf_wnfpRHCbf5zf4IRCcw", "node.id": "0K1Vo0RlStKkgTPhDRa4Bg" ,
elasticsearch_1  | "stacktrace": ["java.lang.IllegalArgumentException: Rejecting mapping update to [nextcloud] as the final mapping would have more than 1 type: [_doc, standard]",
elasticsearch_1  | "at org.elasticsearch.cluster.metadata.MetadataMappingService$PutMappingExecutor.applyRequest(MetadataMappingService.java:273) ~[elasticsearch-7.8.0.jar:7.8.0]",
[...]
elasticsearch_1  | {"type": "deprecation", "timestamp": "2020-07-24T20:09:40,421Z", "level": "WARN", "component": "o.e.d.r.a.d.RestGetAction", "cluster.name": "elastic", "node.name": "elastic-1", "message": "[types removal] Specifying types in document get requests is deprecated, use the /{index}/_doc/{id} endpoint instead.", "cluster.uuid": "Gdf_wnfpRHCbf5zf4IRCcw", "node.id": "0K1Vo0RlStKkgTPhDRa4Bg"  }