Ошибка гема Ruby On Rails Searchkick: «Разница между max_gram и min_gram в NGram Tokenizer должна быть меньше или равна: [1] - PullRequest
0 голосов
/ 04 октября 2019

Итак, я хочу использовать камень поиска в моем приложении RoR. Я просто следую за readme на странице github.

https://github.com/ankane/searchkick

Но когда я запускаю Product.reindex Выдает следующую ошибку:

Elasticsearch::Transport::Transport::Errors::BadRequest: [400] {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"The difference between max_gram and min_gram in NGram Tokenizer must be less than or equal to: [1] but was [49]. This limit can be set by changing the [index.max_ngram_diff] index level setting."}],"type":"illegal_argument_exception","reason":"The difference between max_gram and min_gram in NGram Tokenizer must be less than or equal to: [1] but was [49]. This limit can be set by changing the [index.max_ngram_diff] index level setting."},"status":400}
    from /home/Hendrik/.rvm/gems/ruby-2.3.7/gems/elasticsearch-transport-1.0.6/lib/elasticsearch/transport/transport/base.rb:132:in `__raise_transport_error'
    from /home/Hendrik/.rvm/gems/ruby-2.3.7/gems/elasticsearch-transport-1.0.6/lib/elasticsearch/transport/transport/base.rb:224:in `perform_request'
    from /home/Hendrik/.rvm/gems/ruby-2.3.7/gems/elasticsearch-transport-1.0.6/lib/elasticsearch/transport/transport/http/faraday.rb:20:in `perform_request'
    from /home/Hendrik/.rvm/gems/ruby-2.3.7/gems/elasticsearch-transport-1.0.6/lib/elasticsearch/transport/client.rb:111:in `perform_request'
    from /home/Hendrik/.rvm/gems/ruby-2.3.7/gems/elasticsearch-api-1.0.6/lib/elasticsearch/api/namespace/common.rb:21:in `perform_request'
    from /home/Hendrik/.rvm/gems/ruby-2.3.7/gems/elasticsearch-api-1.0.6/lib/elasticsearch/api/actions/indices/create.rb:77:in `create'
    from /home/Hendrik/.rvm/gems/ruby-2.3.7/gems/searchkick-2.5.0/lib/searchkick/index.rb:14:in `create'
    from /home/Hendrik/.rvm/gems/ruby-2.3.7/gems/searchkick-2.5.0/lib/searchkick/index.rb:184:in `create_index'
    from /home/Hendrik/.rvm/gems/ruby-2.3.7/gems/searchkick-2.5.0/lib/searchkick/index.rb:233:in `reindex_scope'
    from /home/Hendrik/.rvm/gems/ruby-2.3.7/gems/searchkick-2.5.0/lib/searchkick/model.rb:72:in `searchkick_reindex'
    from (irb):5
    from /home/Hendrik/.rvm/gems/ruby-2.3.7/gems/railties-4.1.16/lib/rails/commands/console.rb:90:in `start'
    from /home/Hendrik/.rvm/gems/ruby-2.3.7/gems/railties-4.1.16/lib/rails/commands/console.rb:9:in `start'
    from /home/Hendrik/.rvm/gems/ruby-2.3.7/gems/railties-4.1.16/lib/rails/commands/commands_tasks.rb:69:in `console'
    from /home/Hendrik/.rvm/gems/ruby-2.3.7/gems/railties-4.1.16/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
    from /home/Hendrik/.rvm/gems/ruby-2.3.7/gems/railties-4.1.16/lib/rails/commands.rb:17:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

Он говорит, что я могу изменить значения для max_gram, min_gram и max_ngram_diffв настройках уровня. Но я понятия не имею, что такое настройки уровня или где я могу их найти.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...