Skip to content

Fix tests for 7.x after type removal #826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

robbavey
Copy link
Contributor

No description provided.

@elasticsearch-bot elasticsearch-bot self-assigned this Jan 22, 2019
@@ -32,11 +32,15 @@ def todays_date

def mapping_name
Copy link
Member

@jsvd jsvd Jan 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method becomes a bit less useful now, could we maybe replace it with just

def default_mapping_from_mappings(mappings)
  if ESHelper.es_version_satisfies?(">=7")
    mappings
  else
    mappings["_default_"]  
  end
end

and then:

  def field_properties_from_template(template_name, field)
    mappings = @es.indices.get_template(name: template_name)[template_name]["mappings"]
    mapping = default_mapping_from_mappings(mappings)
    mapping["properties"][field]["properties"]
  end

what do you think?

Copy link
Member

@jsvd jsvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending on green

@elasticsearch-bot
Copy link

Rob Bavey merged this into the following branches!

Branch Commits
master 184ae36, 1be83ba

elasticsearch-bot pushed a commit that referenced this pull request Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants