ankane / searchkick

Intelligent search made easy
MIT License
6.45k stars 747 forks source link

Searchkick 5 #1288

Closed ankane closed 2 years ago

ankane commented 5 years ago

Please create a new issue to discuss any ideas.

edge branch

New

Breaking

Other

Maybe

Waiting for 5.1+

On hold

Before 5

jpaas commented 4 years ago

What do you think about mirroring ES versions? i.e. When you support ES 8 bump version to 8.x.

ankane commented 4 years ago

Hey @jpaas, thanks for the suggestion. I don't see a strong reason to mirror Elasticsearch versions. The plan is for the latest version of Searchkick to always support the 2 most recent Elasticsearch versions.

SteveC commented 4 years ago

Some ideas from recent use of searchkick (thanks!!!)

  1. multi-word synonyms would be super useful
  2. bulk reindex nested object caching. For example when doing MyObject.reindex if it belongs_to OtherObject and I have a model search_data pulling in the nested data, then reindex() will reindex 1,000 records at a time but try to load the nested OtherObject with 1,000 SELECT statements. This is suboptimal if there aren't that many OtherObjects. I've gotten around this with my own little hash cache in the model that for MyObject search_data() goes to my hash of objects instead of through activerecord for the OtherObject when doing any indexing. It helps in my case that OtherObject rarely changes, and maybe rails builtin caching would be better..... but anyway, some sort of built in caching would be awesome for reindexing millions of rows, unless I somehow missed it and it's already there.
  3. convention-based reindex column. searchkick could have a convention of 'needs_reindex' column on objects for when the standard methods fail. For example, the ActiveRecord Import gem allows me to import hundreds of thousands of records very quickly but it bypasses searchkick. While, yes, I can and do track this (well, kinda) and do my own partial reindex, if I could just set a column flag which gets reindexed in some cron (or whatever) job then that would be more awesome, perhaps?
ankane commented 4 years ago

Hey @SteveC, thanks for the ideas!

  1. Would love to support multi-word synonyms, but not sure there's an easy way to do this with the current analyzers. If someone is able to figure it out, happy to review a PR.
  2. The search_import scope should help with N+1 queries for bulk reindexing if you haven't tried that.
  3. It's an interesting idea. I'm not sure I want to add more reindexing patterns right now, but someone could create a gem that wraps Searchkick to do this.

Edit: Think I found a way to do multi-word synonyms (synonyms_v2 branch), so will try to make this part of Searchkick 5.

ankane commented 4 years ago

No point in waiting for Searchkick 5. Reloadable, multi-word, search time synonyms are now available in Searchkick 4.4 :tada:

https://github.com/ankane/searchkick#synonyms

ankane commented 2 years ago

Searchkick 5 is out 🎉