Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Validation Failed: 1: type is missing #95

@agilmore

Description

@agilmore

Hi, was getting this error when trying to indexing content:
Elastica\Exception\ResponseException: Validation Failed: 1: type is missing; in Elastica\Transport\Http->exec() (line 172 of drupal/sites/all/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php).

The following change fixed it for me:

diff --git a/includes/SearchApiElasticsearchIndex.inc b/includes/SearchApiElasticsearchIndex.inc
index 204dae1..0bf56b7 100644
--- a/includes/SearchApiElasticsearchIndex.inc
+++ b/includes/SearchApiElasticsearchIndex.inc
@@ -143,7 +143,8 @@ class SearchApiElasticsearchIndex {
       $documents[] = new Document($id);
     }
     $index = $this->getRealIndex();
-    $index->deleteDocuments($documents);
+    $type = $index->getType($this->search_api_index->machine_name);
+    $type->deleteDocuments($documents);
   }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions