Problem/Motivation

An error occurs after indexing is completed.

{"error":{"root_cause":[{"type":"action_request_validation_exception","reason":"Validation Failed: 1: mapping type is missing;"}],"type":"action_request_validation_exception","reason":"Validation Failed: 1: mapping type is missing;"},"status":400}

screenshot

Steps to reproduce

  1. Install Search API
  2. Add the Elasticsearch server
  3. Add some fields to index
  4. Start indexing
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

miroslav-lee created an issue. See original summary.

miroslav-lee’s picture

Priority: Normal » Major
Status: Active » Needs review
sokru’s picture

Status: Needs review » Needs work

I'm not able to reproduce the issue with steps provided. Are you sure Drupal can connect the Elasticsearch? On attached screenshot "Server index status" it says "Error while checking server index status".

Does it happen only with specific fields/type? If possible try to create more specific instructions how to reproduce the issue.

The MR doesn't seem to be valid. I think correct to debug would be IndexFactory::mapping.

jeremylichtman’s picture

StatusFileSize
new465 bytes

There's a second instance of type missing in IndexFactory in bulkDelete.

sokru’s picture

Version: 8.x-7.0-alpha3 » 8.x-7.x-dev

Could you please either revert the commit fa451e5 or tell me if I have completely misunderstood, that _type is deprecated in Elasticsearch 7.x. See Elasticsearch documentation:
1) https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-...
2) https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-...

uniquename’s picture

I had the same problem before I realized that the module version was not matching the elasticsearch version. Wouldn't it make sense to have a warning about that in the status report section?

pwolanin’s picture

Just found this issue also where I was having problems searching against 7.x when type was in the search path.

Yes, this should be reverted!

mattjones86’s picture

Yeah, this was causing me issues too on ES 7.13.3. I'm using this patch to revert this commit.

sokru’s picture

Status: Needs work » Reviewed & tested by the community

RTBC'ing #9.

andyg5000’s picture

As others have mentioned commit fa451e5 should not have been made to the 8.x-7.x branch and is a breaking change since _type has been removed in ES 7. Please merge the #9 patch to revert this commit and apply it to versions 8.x-6.x (was deprecated in this version) or below.

  • sokru committed 5b7f0f0 on 8.x-7.x
    Issue #3183641 by mattjones86, sokru, pwolanin, andyg5000: Type is...
sokru’s picture

Status: Reviewed & tested by the community » Fixed

Reverted #fa451e5.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.