Someone is having this kind of problem with searchkick? I did something wrong?
article.rb
searchkick suggest: [:status]
scope :search_import, -> { includes(:author, :medium, :tags) }
has_many :article_tags
has_many :tags, through: :article_tags
belongs_to :author
belongs_to :medium
article_controller.rb
def search_article
result_articles = Article.search params[:search],
suggest: true,
fields: %i[title body author.name status],
page: params[:page],
per_page: params[:per_page]
render json: { result_articles: result_articles , time: result_articles.took, suggestion:
result_articles.suggestions }
end
Searchkick::InvalidQueryError ([400] {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"no mapping found for field [status.suggest]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"articles_development_20200918194930310","node":"hVbRSnSiQGW6xSM7pG-36A","reason":{"type":"illegal_argument_exception","reason":"no mapping found for field [status.suggest]"}}],"caused_by":{"type":"illegal_argument_exception","reason":"no mapping found for field [status.suggest]","caused_by":{"type":"illegal_argument_exception","reason":"no mapping found for field [status.suggest]"}}},"status":400}):