Top Banner
Drupal + Solr: Yandex Market with your own hands Eugene Ilyin
36

Ilyin drupal-solr 0

Aug 11, 2015

Download

Documents

DrupalCamp MSK
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Ilyin drupal-solr 0

Drupal + Solr:Yandex Market with your own hands

Eugene Ilyin

Page 2: Ilyin drupal-solr 0

Eugene Ilyin

[email protected]: ilyin.e

I have 5 years experience in Drupal development:● More than 30 projects● Solr for more than on 15 projects● Series of articles about Drupal + Solr on habr● Development of my own modules for search● Patches for existing search modules

Page 3: Ilyin drupal-solr 0

=

Why search is important?

Page 4: Ilyin drupal-solr 0

Statistics● Online sales are growing by 25-30% each year

● 70% of people in Russia shop in the Internet

● Buyers are more likely to use Yandex.Market,

Wikimart, Ebay

Page 5: Ilyin drupal-solr 0

How to adapt the Drupal for growing market demands?

Page 6: Ilyin drupal-solr 0

витрины

визуализация

иерархия

выкладки

гибкие фильтры

Page 7: Ilyin drupal-solr 0

доуточнение выборки

сортировки

промоушен

Page 8: Ilyin drupal-solr 0

Yandex Market Drupal Market

динамично

отзывчиво

Page 9: Ilyin drupal-solr 0

Don't make it on SQLthere are search engines for this

Page 10: Ilyin drupal-solr 0

How to make perfect catalog?

Fulltext search with good stemming

Many options

User-friendly filters

Clever sortings

Dynamic facets

Perfect catalog

Page 11: Ilyin drupal-solr 0

● Search API

● Search API Solr Search

● Facet API

Tools: must have

Page 12: Ilyin drupal-solr 0

● Search API Views

● Facet API Pretty Paths

● Search API Autocomplete

● AJAX Facets

● Search API Sorts

Tools: useful

Page 13: Ilyin drupal-solr 0

Search: basic entities

Search Server

Search Index Search Index

Field Field Field Field Field Field

Facet FacetFacetFacet

Page 14: Ilyin drupal-solr 0

● Quality of search results

● Dynamic set of indexed fields

● Customization of facet filters

● Work with sorting

Main problems

Page 15: Ilyin drupal-solr 0

Quality of search results

+Completeness of the search results

Stemming

Additional fields with tags

Relevance

Weight of fields

Elevation

Boost

Synonyms

Page 16: Ilyin drupal-solr 0

What is stemming?

Mr. Stemmer

Hunspell

Page 17: Ilyin drupal-solr 0

● Enable stemmer in schema.xml

● Prepare dictionaries

● Reindex content

How to configure stemming?

Page 18: Ilyin drupal-solr 0

● Dictionary consists of two files

● File .aff contains the rules for words

● File .dic contains the list of words

What is the structure of dictionaries?

Page 19: Ilyin drupal-solr 0

Synonyms? How it works?

Page 20: Ilyin drupal-solr 0

Configuration of synonyms

Groups of synonyms:

Television, Televisions, TV, TVs

Mappings:

Ifon, I Phone, I-Phone => IPhone

Page 21: Ilyin drupal-solr 0

Dynamic and static attributes

Page 22: Ilyin drupal-solr 0

● Set of attributes changes very often

● How to add attributes into index?

● How to enable facets for new attributes?

Problems of dynamic attributes

Page 23: Ilyin drupal-solr 0

● Module Relations to link entities and attributes

● hook_entity_info_alter to generate fields

● Use the mechanism of Features for facets

How to work with dynamic attributes?

Page 24: Ilyin drupal-solr 0

Facet filters

LinksCheckboxes

DropdownSlider

Interval HierarchyDate & time

Graphs

Page 25: Ilyin drupal-solr 0

Customization of facets

Prepare data Make your widget Done!

Page 26: Ilyin drupal-solr 0

AJAX Facets - how it works?

FilteringAJAX

request to the server

Search by new parameters

Update of filters on the page

Update of search results

Page 27: Ilyin drupal-solr 0

Super Facet!

Page 28: Ilyin drupal-solr 0

Configurable facet

Page 29: Ilyin drupal-solr 0

Sorting of search results

Page 30: Ilyin drupal-solr 0

Sorting and boost query

On stock

To order

Not available

Sorting by relevance

x1000

x100

Page 31: Ilyin drupal-solr 0

Sorting and elevation

Usual results

Elevated

Page 32: Ilyin drupal-solr 0

Not friendly:www.example.com?q=node/1www.example.com/node/1

Friendly:www.example.com/articles/first-article

Human-friendly URL

Page 33: Ilyin drupal-solr 0

www.example.com?f[0]=field_name:value

www.example.com?f[0]=field_brand:bosch

Urls on pages with filters

Page 34: Ilyin drupal-solr 0

Module Facet API Pretty Paths

www.example.com/field_name/value

www.example.com/brand/bosch

Human-friendly urls for filters

Page 35: Ilyin drupal-solr 0

In conclusion Drupal has many components and solutions for search