際際滷

際際滷Share a Scribd company logo
1
www.oroinc.com
Oro Tech Talks:
Advanced Search
with Elasticsearch
www.oroinc.com
About Me
Yevhen Shyshkin
10+ years experience in
E-Commerce development
Architectural Advisor
Project Lead
Technical Trainer
Search Component Lead
twitter.com/yshyshkin github.com/yshyshkin
aspirationandadvisory.com
www.oroinc.com
What is Advanced Search?
Make results more relevant
Discover user preferences
Improve user experience
Tolerate errors and typos
And your any other wish
www.oroinc.com
Elasticsearch: Advanced Search Tool
Search engine based on Lucene
NoSQL DBMS
Extensive search capabilities
Software and hardware tuning
Cluster support
Good for Big Data
Multiple clients: Java, C#, PHP, Python
www.oroinc.com
Elasticsearch in OroCommerce
Relevance boost
Synonyms
Error-tolerance
Search 鍖ne tuning
Autocomplete
Faceted search
Customization
+
www.oroinc.com
Relevance Boost: Theory
Full-text search
Search score (rating)
Default sorting
Show relevant result 鍖rst
Boost increases score
Promote speci鍖c results
www.oroinc.com
Relevance Boost: Implementation
"should": [
{
"match": {
"sku.analyzed": {
"query": "lamp",
"operator": "or",
"boost": 5
}
}
},
{
"match": {
"sku.analyzed_exact_match": {
"query": "lamp",
"operator": "or",
"boost": 50
}
}
}
]
Multi-鍖elds >>
Di鍖erent analyzers >>
Boolean query >>
www.oroinc.com
Relevance Boost: Examples
Boost by exact match >>
Boost by entity name >>
Boost by product attributes >>
Boost by customer history >>
How to use them together
www.oroinc.com
Relevance Boost: Whats next?
Customer segment preferences
Machine learning
Pricing
Inventory
Reviews
www.oroinc.com
Synonyms: Use Cases
Synonyms
Abbreviations
Suggestions
Typos
Mistakes
Slang
www.oroinc.com
Synonyms: Implementation
Search analyzer
Synonym 鍖lter >>
Refresh index settings >>
Direction of replacement
"filter": {
"synonym": {
"type": "synonym_graph",
"synonyms": [
"light, 磺于仂",
"cabinet, 从仂仄仂亟"
]
},
"wordsplit_lowercase_synonym": {
"type": "multiplexer",
"filters": [
"wordsplit, lowercase",
"lowercase, synonym"
]
}
},
"analyzer": {
"fulltext_search_analyzer": {
"filter": [
"wordsplit_lowercase_synonym",
"unique"
],
"tokenizer": "whitespace"
}
}
www.oroinc.com
Synonyms: Examples
Bidirectional synonyms
Unidirectional synonyms
Regular abbreviations
Word shortening
www.oroinc.com
Error-tolerance: Basics
Tolerage minor errors
Ignore typos
Not an autocorrection
www.oroinc.com
Error-tolerance: Implementation
Fuzzy matching >>
One or two errors per word >>
The 鍖rst letter is always correct
Minimum word length >>
Exclusion pattern >>
{
"match": {
"all_text_1.analyzed": {
"query": "ligt",
"operator": "and",
"boost": 1,
"fuzziness": 1,
"prefix_length": 1
}
}
},
{
"match": {
"all_text_1.analyzed": {
"query": "bubl",
"operator": "and",
"boost": 1,
"fuzziness": 1,
"prefix_length": 1
}
}
}
www.oroinc.com
Error-tolerance: Examples
Typos
One or two errors
Exclude SKU
www.oroinc.com
Customization: Basics
Data level
Query level
www.oroinc.com
Customization: Data Level
Add new data
New 鍖eld
Global search text 鍖eld
Events
PrepareEntityMapEvent >>
IndexEntityEvent >>
www.oroinc.com
Customization: Query Level
Request builders >>
Decorate existing builder
Create new builder
Events
BeforeSearchEvent (standard) >>
BeforeSearchEvent (website) >>
www.oroinc.com
Documentation
Search index architecture >>
Fine-tuning >>
Elasticsearch guide >>
Elasticsearch forum >>
www.oroinc.com
Q&A

More Related Content

Advanced Search with Elasticsearch