Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Illegal argument "type" sent in all requests upgrading to 8.x #1049

Open
@cjba7

Description

@cjba7

Aloha,

The ruby API gem, 'elasticsearch-api', alongside this gem seem to send a parameter on all requests when using 8.5 (also tested on 8.4 and 8.3).

At present I've got 7.5.0 in the Gemfile and all works as expected with an ES8.5 cluster.

Working

Gemfilegem 'elasticsearch', '7.5.0'gem 'elasticsearch-api', '7.5.0'gem 'elasticsearch-model'gem 'elasticsearch-rails'Gemfile.lockelasticsearch (7.5.0)  elasticsearch-api (= 7.5.0)  elasticsearch-transport (= 7.5.0)elasticsearch-api (7.5.0)  multi_jsonelasticsearch-model (7.2.1)  activesupport (> 3)  elasticsearch (~> 7)  hashieelasticsearch-rails (7.2.1)elasticsearch-transport (7.5.0)  faraday (>= 0.14, < 1)  multi_json

Kerploding

Gemfilegem 'elasticsearch', '8.5.0'gem 'elasticsearch-api', '8.5.0'gem 'elasticsearch-model'gem 'elasticsearch-rails'Gemfile.lockelastic-transport (8.1.0)  faraday (< 3)  multi_jsonelasticsearch (8.5.0)  elastic-transport (~> 8)  elasticsearch-api (= 8.5.0)elasticsearch-api (8.5.0)  multi_jsonelasticsearch-model (7.1.1)  activesupport (> 3)  elasticsearch (> 1)  hashieelasticsearch-rails (7.2.1)

Example

2.7.6 :001 > Car.__elasticsearch__.search({}).results.countETHON: performed EASY effective_url=http://localhost:10005/cars/_search?type response_code=400 return_code=ok total_time=0.00252curl -X POST -H 'Authorization: Basic Og==, x-elastic-client-meta: es=8.5.0,rb=2.7.6,t=8.1.0,fd=0.17.6,ty=1.4.0, User-Agent: elastic-transport-ruby/8.1.0 (RUBY_VERSION: 2.7.6; darwin x86_64; Faraday v0.17.6), Content-Type: application/json' 'http://localhost:9200/cars/_search?pretty&type' -d '{}'# 2022-11-24T12:35:04+01:00 [400] (0.004s)## {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"request [/cars/_search] contains unrecognized parameter: [type]"}],"type":"illegal_argument_exception","reason":"request [/cars/_search] contains unrecognized parameter: [type]"},"status":400}Traceback (most recent call last):        2: from (irb):1        1: from (irb):1:in `count'Elastic::Transport::Transport::Errors::BadRequest ([400] {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"request [/cars/_search] contains unrecognized parameter: [type]"}],"type":"illegal_argument_exception","reason":"request [/cars/_search] contains unrecognized parameter: [type]"},"status":400})

type appears to be added here:https://github.com/elastic/elasticsearch-rails/blob/main/elasticsearch-model/lib/elasticsearch/model/searching.rb#L57-L59

However we can see here in the comments the allowed parameters does not allowtype:https://github.com/elastic/elasticsearch-ruby/blob/main/elasticsearch-api/lib/elasticsearch/api/actions/search.rb#L26-L72

Main reason for our upgrade

We need to start using ES Cloud ID and API key which, according to Elasticsearch support, is not supported in gems of 7.5 versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp