ankane / searchkick

Intelligent search made easy
MIT License
6.55k stars 760 forks source link

Inconsistent documentation for inheritance #1560

Closed KevinColemanInc closed 2 years ago

KevinColemanInc commented 2 years ago

The ReadMe says:

By default, all string fields are searchable (can be used in fields option). Speed up indexing and reduce index size by only making some fields searchable.

and

By default, all string fields are filterable (can be used in where option). Speed up indexing and reduce index size by only making some fields filterable.

But the ReadMe also says:

In your parent model, set:

class Animal < ApplicationRecord
  searchkick inheritance: true
end

I tried filtering by type (a string field) without the inheritance: true and it didn't work. Searchkick also strangely mutates the string value when storing in ES. In ActiveRecord, the type column is stored like 'Networks::Track', but Searchkick mutates the string to be 'networks/track'

My suggestion is is to not say "all strings are filterable by default" and to document any mutations that happen between ActiveRecords and ElasticKick fields.

ankane commented 2 years ago

Hey @KevinColemanInc, please use the script in the bug report template to reproduce.

KevinColemanInc commented 2 years ago

Resubmitted under: https://github.com/ankane/searchkick/issues/1561