From f8d0cf89d61dc14de6e462dead40bd303acf0ae9 Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Mon, 1 Jul 2019 22:16:20 -0700 Subject: [PATCH] docs(search): remove search from 2.0, next sidebars; remove file from next --- public-docs/core-plugins-search.md | 111 ------------------ website/sidebars.json | 1 - .../version-2.0.0-sidebars.json | 3 +- 3 files changed, 1 insertion(+), 114 deletions(-) delete mode 100644 public-docs/core-plugins-search.md diff --git a/public-docs/core-plugins-search.md b/public-docs/core-plugins-search.md deleted file mode 100644 index 43b867e1d..000000000 --- a/public-docs/core-plugins-search.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: Search Plugins (Meteor) ---- - -Search is an important part of any ecommerce solution as studies have found that -40-50% of users will completely bypass traditional navigation and head straight -to search. - -In addition to being critical, Search is rarely the same for every merchant. How -you organize, categorize, and market your products will affect how you want -search to behave. So we have tried to create an search plugin that is customizable, -expandable, and ultimately replaceable. - -## Decoupled Interface - -One of the things we tried to do was ensure that you could replace one part -of the search interface with another without having to rewrite all of it. To do so -we broke the search down into a back-end and front-end component each of which -can be replaced with another that uses the same interface. This was accomplished -by using a publication to communicate between these two plugins. - -The `search-mongo` plugin creates a `SearchResult` publication that can be consumed -by any front-end, but by default is consumed by the `ui-search` plugin. But any -back-end that creates this same publication will be utilized by the front-end plugin. - -## search-mongo plugin - -This plugin implements the server-side elements of search. This plugin was a -compromise between more sophisticated engines like Elastic Search that require -more maintenance and setup and trying to create a plugin that will meet the needs -of most developers. - -This plugin tries to provide a comprehensive product search, while also providing a -relatively simple search API for orders and accounts. - -For product search this plugin leverages Mongo's own built-in [full-text search](https://docs.mongodb.com/manual/reference/operator/query/text/) -capabilities which provides more intelligent matching algorithms than just plain text searches and -gives a "weight" based on the quality of the match. It also allows admins to customize -which fields they include and what ranking they are given through the admin -interface. - -In addition it will create dedicated search collections which allows the search -to operate only on a subset of fields and records. This allows for quick -searches even on large product recordsets. In our own testing we were able to search -a product database of more than 50k records and still get <20ms response times. Developers -who customize the Product database can add fields here without too much extra code. Simply -adding them to the settings should work in most cases (in addition you can add -transformations, see below). Every effort was made to not hardcode these fields into -the collection maintenance method. - -Creating and maintaining these search collections is all handled automatically -in the background using Job Queues and hooks. In some cases changing the configuration -of the Product search may require rebuilding it, but this is also handled automatically -in the background. - -The OrderSearch and AccountSearch collections are similar indexes of this data, -however the search function is simpler. The Order search looks up orders by -ID, email address, phone, or billing/shipping name. The Account search looks up accounts by -phone, email, or first or last name. - -Account search is restricted to users who have the `reaction-accounts` permission. Order -search is restricted to users to users with `order` permissions. Users who don't -have these rights will not be able to search and will not see the options available in the -search box. - -### Transformations - -This is something that will be expanded on later, but this allows you to write -functions that will transform a particular field to make it work better for search. -A common transform will be to "flatten-out" some fields that are deeply nested -in the database to make them work with search, but anything you can put in a function -can be added here without touching the core code, hopefully making upgrading easier -in the future. - -## ui-search plugin - -The `ui-search` plugin implements the client-side elements of search - a UI interface, and a subscription to the SearchResults publication created by the search-mongo plugin. - -To subscribe to the SearchResults publication, you must provide the collection you wish to search, the search term (`searchQuery`), and optionally the `facets` you wish to filter by. - -Typing in the input field updates the search term by changing the `searchQuery` variable. Updates are sent on every keypress. - -Aside from the search icon in Reaction's default navigation bar, all of search is contained inside a full-screen modal window, which appears on-click of the referenced search icon. - -### Product Search - -By default, product search will search `Title`, `Description`, `Details` and `Vendor`. These options can be changed in the `Search Settings` dashboard. - -Clicking on a tag adds that tags `_id` into an array, referred to in the code as `facets`. Clicking a second time removes the tag from the array. - -`this.subscribe("SearchResults", "products", searchQuery, facets);` - -Search is performed in a keyword and filter manner: users will use the traditional input field to search for a keyword, and once results are found, they will be displayed, with all tags associated with the returned products displayed directly below the input. - -Clicking a tag will filter the results, returning results that both 1) meet the initial keyword and 2) have the associated tag attached. The more tags clicked, the more filters applied, and (most likely) the fewer the results shown. - -![Search](/assets/developer-search-ui.png) - -The product UI purposely mimics our existing product-grid templates. CSS class names are identical to those in our product-grid, however all styling is applied completely separate from the traditional product-grid, using the LESS inside of `/imports/plugins/included/default-theme/client/styles/search/results.less`, which is wrapped in an encompassing `.search-modal` wrapper. Changing any styling on the traditional product-grid should not affect the search grid, and vice versa. - -### Account Search - -Account search will search by `Name`, `Phone`, and `Email`. Clicking on `Manage` will close the search modal and redirect to the dashboards `Account` settings for that particular user. - -### Order Search - -Order search will search by `Order ID`, `Name`, and `Email`. Clicking on the order ID will close the search modal and redirect to the dashboards `Orders` panel for that particular order. - -#### Sortable Table - -The Account and Order search results both display in a sortable table, which is a React component wrapped around an npm module called `Taco Table`. We've tried to keep Taco Table as minimalistic as possible, however it is easily expandable. You can find docs in their [GitHub Repo](https://github.com/pbeshai/react-taco-table). diff --git a/website/sidebars.json b/website/sidebars.json index 4f6a3820d..0943a35f1 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -67,7 +67,6 @@ "Core Plugins": [ "core-plugins-intro", "core-plugins-marketplace", - "core-plugins-search", "core-plugins-stripe", "core-plugins-simple-inventory", "core-plugins-sitemap-generator", diff --git a/website/versioned_sidebars/version-2.0.0-sidebars.json b/website/versioned_sidebars/version-2.0.0-sidebars.json index 2a1cc8c49..402b60991 100644 --- a/website/versioned_sidebars/version-2.0.0-sidebars.json +++ b/website/versioned_sidebars/version-2.0.0-sidebars.json @@ -66,8 +66,7 @@ ], "Core Plugins": [ "version-2.0.0-core-plugins-intro", - "version-2.0.0-core-plugins-marketplace", - "version-2.0.0-core-plugins-search", + "version-2.0.0-core-plugins-marketplace" "version-2.0.0-core-plugins-stripe", "version-2.0.0-core-plugins-simple-inventory", "version-2.0.0-core-plugins-sitemap-generator",