the new way of searching in magento 2
TRANSCRIPT
![Page 1: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/1.jpg)
![Page 2: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/2.jpg)
The new way of searching in Magento 2
![Page 4: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/4.jpg)
E-commerce Search
Why on-site Search matters
![Page 5: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/5.jpg)
Why on-site Search matters
• Searching has become the predominant method for users to find products on websites.
• The Search feature on website is immensely important as those searching have a better idea of what they want, compared to those who are browsing using the site links and navigation.
Searchers are almost twice as likely to convert than non-searchers in a given visit.
![Page 6: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/6.jpg)
200+ M1 Search extensions on Magento Connect
![Page 7: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/7.jpg)
M1 Search problems
Like, Full Text, Combined -
confusing for merchants.
Limited ability for extension
and customization
High degrees of code coupling
Weighting attributes only available in EE
Like, Combined are SLOW
Low Search Accuracy
![Page 8: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/8.jpg)
M1 Search problems
FullText Search doesn’t support partial phrase
matching
MyISAM FullText by default ignores
words under 4 characters
There is no SOLR 4.*
support for EE version
MyISAM FullText has a list of ignored
words
Others
![Page 9: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/9.jpg)
Community Feedback
https://github.com/magento/magento2/issues/622
![Page 10: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/10.jpg)
Community Feedback
https://github.com/magento/magento2/issues/622
![Page 11: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/11.jpg)
E-commerce Search
Deep Dive
![Page 12: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/12.jpg)
The 12 Query Types
Identified during large-scale usability study of e-commerce search made by Baymard Institute
![Page 13: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/13.jpg)
5 essential query types
1. Exact2. Product Type3. Feature4. Thematic5. Relational Searches.
Users can get by with basic e-commerce search when these 5 query types are supported. Conversely, failing to support any of these core query types will result in a defective search experience.
![Page 14: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/14.jpg)
New way of Searching
Declarative Search
![Page 15: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/15.jpg)
Declarative search. Request parts
1Filters
2Queries
3Aggregation
1. Exact matching2. Binary yes/no searches
1. Full text searches2. Relevance sorting
1. Faceted Search
![Page 16: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/16.jpg)
Declarative Search. Queries
app\code\Magento\CatalogSearch\etc\search_request.xml
![Page 17: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/17.jpg)
Declarative Search. Filters
app\code\Magento\CatalogSearch\etc\search_request.xml
![Page 18: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/18.jpg)
Declarative Search. Aggregations
app\code\Magento\CatalogSearch\etc\search_request.xml
![Page 19: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/19.jpg)
Search Service Contract
![Page 20: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/20.jpg)
Basic workflow
![Page 21: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/21.jpg)
Simple Example
1. User inputs search request into the quick search form. For example: “gold iPhone“
2. Search request comes to back-end and Magento fulfill \Magento\Search\Api\SearchInterfaces::search(SearchCriteriaInterface $searchCriteria)
3. Implementation reads declaration for current search request (Quick Search) .
4. Add Searchable attributes including custom attributes.Add Filter queries for visibility, price, category, colorAggregations for: price, color, category
![Page 22: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/22.jpg)
Simple Example
5. Bind user's data:“gold iPhone" ->
<query xsi:type="matchQuery" value="$search_term$" name="search"> "visibility" -> Search (2) and Category and Search (4)
6. Clean unused queries and filters:price, category, color (filter)
7. Build final request
8. Search engine handles request and gets results
![Page 23: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/23.jpg)
Simple Example. Result
![Page 24: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/24.jpg)
Library vs Adapter
Adapters are supposed to be a set of factories which build generic search entities handled in client’s code
![Page 25: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/25.jpg)
The right way to write own Search Extensions
SmartSearch - https://github.com/Sebwite/Magento2-SmartSearch
![Page 26: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/26.jpg)
SmartSearch API usage
![Page 27: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/27.jpg)
Performance
* Don’t consider values. Important just a trend
![Page 28: The new way of searching in Magento 2](https://reader035.vdocument.in/reader035/viewer/2022062412/5871af131a28abda6a8b6391/html5/thumbnails/28.jpg)
Magento meets Elasticsearch
1.7.* and 2.* versions supported