Commit af6c676a364fbced2adb7dcf1ba316e671b90198
1 parent
c52dbd0f
Exists in
master
and in
8 other branches
Improved intelligent search section [skip ci]
Showing
1 changed file
with
5 additions
and
13 deletions
Show diff stats
README.md
@@ -590,11 +590,7 @@ end | @@ -590,11 +590,7 @@ end | ||
590 | 590 | ||
591 | ## Intelligent Search | 591 | ## Intelligent Search |
592 | 592 | ||
593 | -### Analytics | ||
594 | - | ||
595 | -The best starting point to improve your search **by far** is to track searches and conversions. | ||
596 | - | ||
597 | -[Searchjoy](https://github.com/ankane/searchjoy) makes it easy. | 593 | +The best starting point to improve your search **by far** is to track searches and conversions. [Searchjoy](https://github.com/ankane/searchjoy) makes it easy. |
598 | 594 | ||
599 | ```ruby | 595 | ```ruby |
600 | Product.search "apple", track: {user_id: current_user.id} | 596 | Product.search "apple", track: {user_id: current_user.id} |
@@ -607,15 +603,9 @@ Focus on: | @@ -607,15 +603,9 @@ Focus on: | ||
607 | - top searches with low conversions | 603 | - top searches with low conversions |
608 | - top searches with no results | 604 | - top searches with no results |
609 | 605 | ||
610 | -### Conversions | ||
611 | - | ||
612 | -Searchkick can use conversion data to learn what users are looking for. If a user searches for “ice cream” and adds Ben & Jerry’s Chunky Monkey to the cart (our conversion metric at Instacart), that item gets a little more weight for similar searches. | 606 | +Searchkick can then use the conversion data to learn what users are looking for. If a user searches for “ice cream” and adds Ben & Jerry’s Chunky Monkey to the cart (our conversion metric at Instacart), that item gets a little more weight for similar searches. |
613 | 607 | ||
614 | -The first step is to define your conversion metric and start tracking conversions. The database works well for low volume, but feel free to use Redis or another datastore. | ||
615 | - | ||
616 | -Searchkick automatically treats `apple` and `APPLE` the same. | ||
617 | - | ||
618 | -Next, add conversions to the index. | 608 | +Add conversion data with: |
619 | 609 | ||
620 | ```ruby | 610 | ```ruby |
621 | class Product < ApplicationRecord | 611 | class Product < ApplicationRecord |
@@ -639,6 +629,8 @@ Reindex and set up a cron job to add new conversions daily. | @@ -639,6 +629,8 @@ Reindex and set up a cron job to add new conversions daily. | ||
639 | rake searchkick:reindex CLASS=Product | 629 | rake searchkick:reindex CLASS=Product |
640 | ``` | 630 | ``` |
641 | 631 | ||
632 | +This can make a huge difference on the quality of your search. | ||
633 | + | ||
642 | **Note:** For a more performant (but more advanced) approach, check out [performant conversions](#performant-conversions). | 634 | **Note:** For a more performant (but more advanced) approach, check out [performant conversions](#performant-conversions). |
643 | 635 | ||
644 | ## Personalized Results | 636 | ## Personalized Results |