Here's the full error message:
Searchkick::InvalidQueryError: Searchkick::InvalidQueryError: [400] {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [foo_name] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory."}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"foos_test","node":"k0yYkVnIQzaXbvpAG_rKgw","reason":{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [foo_name] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory."}}],"caused_by":{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [foo_name] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory."}},"status":400}
I get this error (this error only shows in minitest) when I add the code below in index action:
order: {foo_name: :asc}
Here's my full index code:
def index
query = params[:q].presence || "*"
@foos = Foo.search(
query,
page: params[:page], per_page: 25,
order: {foo_name: :asc}
)
end
end
I'm using Searchkick.