Transforming WordPress Search and Query Performance with Elasticsearch

Taylor Lovett
Taylor LovettDirector of Web Engineering at 10up
Modernizing WordPress
Search with Elasticsearch
Who Am I?
• My name is Taylor Lovett
• Director of Web Engineering at 10up
• Open source community member
• WordPress core contributor
• ElasticPress team member
@tlovett12
Doesn’t WordPress have
search built-in?
WordPress Search is Rudimentary
• Only searches post title, content, and excerpt.
• Relies on MySQL and thus is slow.
• Relevancy calculations are poor and overly
simplistic.
• Not able to handle any advanced filtering.
Think Beyond Search
WordPress Complex Queries Are Slow
• Querying for posts that contain multiple meta
keys.
• Querying for posts that contain multiple
taxonomies.
What is Elasticsearch?
http://www.elastic.co
Elasticsearch
• Open-source search server written in Java
based on a technology called Lucene (open-
source search software by Apache).
• A standalone database server that provides a
RESTful interface to accept and store data in a
way that is optimized for search and multi-
dimensional queries.
• Extremely scalable, performant, and reliable
Elasticsearch
• Relevant results
• Performant aggregation queries
• Autosuggest
• Fuzzy matching
• Geographic searches and queries
• Filterable searches and queries
• Data weighting
• Much more
Get an Elasticsearch Server
• Very flexible and customizable. There is not
really a “one size fits all” setup. Generally, you
have two options:
• Option 1: Pay someone else to manage/host
your Elasticsearch cluster (SaaS)
• Option 2: Host your own cluster
Elasticsearch SaaS
• elasticpress.io
• qbox.io
• heroku.com
• elastic.co
What is ElasticPress?
https://wordpress.org/plugins/elasticpress
ElasticPress
ElasticPress is a fast and flexible search and
query engine for WordPress.
ElasticPress Features
• Instantly find the content you’re looking for. The
first time. Advanced relevancy algorithm which
includes date weighting, term/meta searching,
fuzzy matching, and more.
• Search and query across multiple blogs in a
multisite instance.
• Extremely performant related content widget.
ElasticPress Features
• Dramatically improve performance of admin queries to
assist editors in finding content.
• Indexes text inside of popular file types (pdf, ppt, doc,
etc), and adds those files types to search results.
• Autosuggest for search - suggest relevant content as
text is entered into the search field.
• WooCommerce integration that improves faceting and
product look up speed as well as order search in the
admin.
ElasticPress Requirements
• WordPress 3.7+
• An instance of Elasticsearch.
Installation
• Github: http://github.com/10up/elasticpress
• WordPress.org: http://wordpress.org/plugins/
elasticpress
Connect to Elasticsearch
Activate Features
Sync Your Content
Query API
Query Integration
new WP_Query( array(

’s’ => ‘search terms’,

‘author_name’ => ‘taylor’,

…

) );
new WP_Query( array(

’ep_integrate’ => ‘true’,

‘author_name’ => ‘taylor’,

…

) );
new WP_Query( array(

‘author_name’ => ‘taylor’,

…

) );
Advanced Query API
• Search taxonomy terms
• Filter by taxonomy terms (unlimited dimensions)
• Search post meta
• Filter by post meta (unlimited dimensions)
• Search authors
• Filter by authors
• Search across blogs in multisite
• Complex date filtering
• more!
Example Queries
new WP_Query( array(

’s’ => ‘vienna austria’,

‘sites’ => ‘all’,

) );
Example Queries
new WP_Query( array(

’s’ => ‘vienna austria’,

‘search_fields’ => array(

‘post_title’,

‘post_content’,

‘taxonomies’ => array( ‘category’ ),

),

) );
Example Queries
new WP_Query( array(

’s’ => ‘vienna austria’,

‘post_type’ => ‘page’,

‘author_name’ => ‘taylor’,

‘search_fields’ => array(

‘post_title’,

‘post_content’,

‘meta’ => array( ‘city_name’ ),

),

) );
Example Queries
new WP_Query( array(

’s’ => ‘vienna austria’,

‘tax_query’ => array(

array(

‘taxonomy’ => ‘category’,

‘terms’ => array( ‘term1’, ‘term2’ ),

),

),

‘search_fields’ => array(

‘post_title’,

‘post_content’,

‘meta’ => array( ‘city_name’ ),

‘author_name’,

),

‘site’ => 3,

) );
Example Queries
new WP_Query( array(

‘ep_integrate’ => true,

‘tax_query’ => array(

array(

‘taxonomy’ => ‘category’,

‘terms’ => array( ‘term1’, ‘term2’ ),

‘operator’ => ‘or’,

),

array(

‘taxonomy’ => ‘custom_tax’,

‘terms’ => array( ‘customterm1’ ),

),

array(

‘taxonomy’ => ‘post_tag’,

‘terms’ => array( ‘tag1’ ),

),

‘relation’ => ‘OR’,

),

) );
Example Queries
new WP_Query( array(

‘ep_integrate’ => true,

‘meta_query’ => array(

array(

‘key’ => ‘city_name’,

‘value’ => ‘vienna’,

),

array(

‘key’ => ‘number_key’,

‘value’ => 5,

‘compare’ => ‘>’,

),

array(

‘key’ => ‘exists_key’,

‘compare’ => ‘exists’,

),

),

) );
WP_Query Integration
• We want to be able to run all (slower) WP_Query
instances through Elasticsearch.
• This means we have to support every query
parameter which isn’t the case yet. Github
contains a full list of parameters WP_Query
supports with ElasticPress and usage for each
parameter.
ElasticPress in Your Language
• ElasticPress is designed to be internationalized.
• Out of the box, it will work fine with most
languages.
Analysis and Analyzers
• When a document is indexed in Elasticsearch,
text is analyzed, broken into terms (tokenized),
and normalized with token filters.
• In normalization, strings might be lowercased
and plurals stripped.
Custom Analyzers
• ElasticPress by default uses a pretty standard set of
analyzers intended for the English language.
• We can easily customize our analyzers for use with
other languages by filtering ep_config_mapping
(see EP source code).
• You can read about language specific analyzers here:



http://www.elasticsearch.org/guide/en/elasticsearch/
reference/current/analysis-lang-analyzer.html
Documentation
Full documentation with installation instructions:



https://github.com/10up/ElasticPress
Feedback and Continuing Development
• If you are using ElasticPress on a project, please
let us know and give us feedback.
• Pull requests are welcome!
Questions?
We need to send a PUT request to this endpoint with
our post data. Of course we must authenticate before
doing this.
@tlovett12
taylor.lovett@10up.com
http://elasticpress.io
1 of 36

Recommended

Modernizing WordPress Search with Elasticsearch by
Modernizing WordPress Search with ElasticsearchModernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with ElasticsearchTaylor Lovett
1.5K views39 slides
Modernizing WordPress Search with Elasticsearch by
Modernizing WordPress Search with ElasticsearchModernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with ElasticsearchTaylor Lovett
51.2K views48 slides
What You Missed in Computer Science by
What You Missed in Computer ScienceWhat You Missed in Computer Science
What You Missed in Computer ScienceTaylor Lovett
6.5K views36 slides
You Got React.js in My PHP by
You Got React.js in My PHPYou Got React.js in My PHP
You Got React.js in My PHPTaylor Lovett
7.2K views31 slides
Best Practices for Building WordPress Applications by
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsTaylor Lovett
6.1K views50 slides
Best Practices for WordPress in Enterprise by
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseTaylor Lovett
10.8K views59 slides

More Related Content

What's hot

The JSON REST API for WordPress by
The JSON REST API for WordPressThe JSON REST API for WordPress
The JSON REST API for WordPressTaylor Lovett
30.9K views37 slides
Supercharging WordPress Development - Wordcamp Brighton 2019 by
Supercharging WordPress Development - Wordcamp Brighton 2019Supercharging WordPress Development - Wordcamp Brighton 2019
Supercharging WordPress Development - Wordcamp Brighton 2019Adam Tomat
612 views64 slides
Ako prepojiť aplikáciu s Elasticsearch by
Ako prepojiť aplikáciu s ElasticsearchAko prepojiť aplikáciu s Elasticsearch
Ako prepojiť aplikáciu s Elasticsearchbart-sk
900 views32 slides
Day 7 - Make it Fast by
Day 7 - Make it FastDay 7 - Make it Fast
Day 7 - Make it FastBarry Jones
897 views30 slides
JSON REST API for WordPress by
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPressTaylor Lovett
10.5K views37 slides
Ch7(publishing my sql data on the web) by
Ch7(publishing my sql data on the web)Ch7(publishing my sql data on the web)
Ch7(publishing my sql data on the web)Chhom Karath
157 views10 slides

What's hot(20)

The JSON REST API for WordPress by Taylor Lovett
The JSON REST API for WordPressThe JSON REST API for WordPress
The JSON REST API for WordPress
Taylor Lovett30.9K views
Supercharging WordPress Development - Wordcamp Brighton 2019 by Adam Tomat
Supercharging WordPress Development - Wordcamp Brighton 2019Supercharging WordPress Development - Wordcamp Brighton 2019
Supercharging WordPress Development - Wordcamp Brighton 2019
Adam Tomat612 views
Ako prepojiť aplikáciu s Elasticsearch by bart-sk
Ako prepojiť aplikáciu s ElasticsearchAko prepojiť aplikáciu s Elasticsearch
Ako prepojiť aplikáciu s Elasticsearch
bart-sk900 views
Day 7 - Make it Fast by Barry Jones
Day 7 - Make it FastDay 7 - Make it Fast
Day 7 - Make it Fast
Barry Jones897 views
JSON REST API for WordPress by Taylor Lovett
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPress
Taylor Lovett10.5K views
Ch7(publishing my sql data on the web) by Chhom Karath
Ch7(publishing my sql data on the web)Ch7(publishing my sql data on the web)
Ch7(publishing my sql data on the web)
Chhom Karath157 views
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 Minutes by Nina Zakharenko
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 MinutesDjangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 Minutes
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 Minutes
Nina Zakharenko4.8K views
Get Django, Get Hired - An opinionated guide to getting the best job, for the... by Marcel Chastain
Get Django, Get Hired - An opinionated guide to getting the best job, for the...Get Django, Get Hired - An opinionated guide to getting the best job, for the...
Get Django, Get Hired - An opinionated guide to getting the best job, for the...
Marcel Chastain631 views
Dcm#8 elastic search by Ivan Wallarm
Dcm#8  elastic searchDcm#8  elastic search
Dcm#8 elastic search
Ivan Wallarm605 views
Beyond The Browser - Creating a RESTful Web Service With WordPress by Christopher Reding
Beyond The Browser - Creating a RESTful Web Service With WordPressBeyond The Browser - Creating a RESTful Web Service With WordPress
Beyond The Browser - Creating a RESTful Web Service With WordPress
Christopher Reding6.3K views
CouchDB for Web Applications - Erlang Factory London 2009 by Jason Davies
CouchDB for Web Applications - Erlang Factory London 2009CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009
Jason Davies2.2K views
Real World REST with Atom/AtomPub by Peter Keane
Real World REST with Atom/AtomPubReal World REST with Atom/AtomPub
Real World REST with Atom/AtomPub
Peter Keane4K views
Software Development with Open Source by OpusVL
Software Development with Open SourceSoftware Development with Open Source
Software Development with Open Source
OpusVL773 views
Introduction to CouchDB by OpusVL
Introduction to CouchDBIntroduction to CouchDB
Introduction to CouchDB
OpusVL1.4K views
ElasticSearch for .NET Developers by Ben van Mol
ElasticSearch for .NET DevelopersElasticSearch for .NET Developers
ElasticSearch for .NET Developers
Ben van Mol1.3K views
Postman Collection Format v2.0 (pre-draft) by Postman
Postman Collection Format v2.0 (pre-draft)Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)
Postman208.3K views

Similar to Transforming WordPress Search and Query Performance with Elasticsearch

Wordpress search-elasticsearch by
Wordpress search-elasticsearchWordpress search-elasticsearch
Wordpress search-elasticsearchTaylor Lovett
23.3K views48 slides
PostgreSQL - It's kind've a nifty database by
PostgreSQL - It's kind've a nifty databasePostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty databaseBarry Jones
5.1K views27 slides
Full Text Search In PostgreSQL by
Full Text Search In PostgreSQLFull Text Search In PostgreSQL
Full Text Search In PostgreSQLKarwin Software Solutions LLC
60.2K views51 slides
Technologies for Websites by
Technologies for WebsitesTechnologies for Websites
Technologies for WebsitesCompare Infobase Limited
212 views10 slides
Victoria wordpress by
Victoria wordpressVictoria wordpress
Victoria wordpressFlynn O'Connor
1.2K views21 slides
Technical Utilities for your Site by
Technical Utilities for your SiteTechnical Utilities for your Site
Technical Utilities for your SiteCompare Infobase Limited
427 views10 slides

Similar to Transforming WordPress Search and Query Performance with Elasticsearch (20)

Wordpress search-elasticsearch by Taylor Lovett
Wordpress search-elasticsearchWordpress search-elasticsearch
Wordpress search-elasticsearch
Taylor Lovett23.3K views
PostgreSQL - It's kind've a nifty database by Barry Jones
PostgreSQL - It's kind've a nifty databasePostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty database
Barry Jones5.1K views
Advanced full text searching techniques using Lucene by Asad Abbas
Advanced full text searching techniques using LuceneAdvanced full text searching techniques using Lucene
Advanced full text searching techniques using Lucene
Asad Abbas1.4K views
Full Text Search with Lucene by WO Community
Full Text Search with LuceneFull Text Search with Lucene
Full Text Search with Lucene
WO Community6.7K views
Getting started with Laravel & Elasticsearch by Peter Steenbergen
Getting started with Laravel & ElasticsearchGetting started with Laravel & Elasticsearch
Getting started with Laravel & Elasticsearch
Episerver and search engines by Mikko Huilaja
Episerver and search enginesEpiserver and search engines
Episerver and search engines
Mikko Huilaja1.2K views
[2D1]Elasticsearch 성능 최적화 by NAVER D2
[2D1]Elasticsearch 성능 최적화[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화
NAVER D230.5K views
Elastic & Azure & Episever, Case Evira by Mikko Huilaja
Elastic & Azure & Episever, Case EviraElastic & Azure & Episever, Case Evira
Elastic & Azure & Episever, Case Evira
Mikko Huilaja358 views
[2 d1] elasticsearch 성능 최적화 by Henry Jeong
[2 d1] elasticsearch 성능 최적화[2 d1] elasticsearch 성능 최적화
[2 d1] elasticsearch 성능 최적화
Henry Jeong3.5K views
(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics by Amazon Web Services
(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics
(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics
Amazon Web Services54.2K views
AWS October Webinar Series - Introducing Amazon Elasticsearch Service by Amazon Web Services
AWS October Webinar Series - Introducing Amazon Elasticsearch ServiceAWS October Webinar Series - Introducing Amazon Elasticsearch Service
AWS October Webinar Series - Introducing Amazon Elasticsearch Service
Amazon Web Services41.7K views
Examiness hints and tips from the trenches by Ismail Mayat
Examiness hints and tips from the trenchesExaminess hints and tips from the trenches
Examiness hints and tips from the trenches
Ismail Mayat1.8K views
An Introduction to Elastic Search. by Jurriaan Persyn
An Introduction to Elastic Search.An Introduction to Elastic Search.
An Introduction to Elastic Search.
Jurriaan Persyn71.1K views
Infinispan,Lucene,Hibername OGM by JBug Italy
Infinispan,Lucene,Hibername OGMInfinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGM
JBug Italy1.4K views
Search Engines: Best Practice by Yuliya_Prach
Search Engines: Best PracticeSearch Engines: Best Practice
Search Engines: Best Practice
Yuliya_Prach897 views

Recently uploaded

Piloting & Scaling Successfully With Microsoft Viva by
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft VivaRichard Harbridge
12 views160 slides
Five Things You SHOULD Know About Postman by
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About PostmanPostman
33 views43 slides
Future of Indian ConsumerTech by
Future of Indian ConsumerTechFuture of Indian ConsumerTech
Future of Indian ConsumerTechKapil Khandelwal (KK)
21 views68 slides
Future of AR - Facebook Presentation by
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentationssuserb54b561
14 views27 slides
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc
10 views29 slides
Ransomware is Knocking your Door_Final.pdf by
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdfSecurity Bootcamp
55 views46 slides

Recently uploaded(20)

Piloting & Scaling Successfully With Microsoft Viva by Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman33 views
Future of AR - Facebook Presentation by ssuserb54b561
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
ssuserb54b56114 views
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc10 views
6g - REPORT.pdf by Liveplex
6g - REPORT.pdf6g - REPORT.pdf
6g - REPORT.pdf
Liveplex10 views
HTTP headers that make your website go faster - devs.gent November 2023 by Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn22 views
Case Study Copenhagen Energy and Business Central.pdf by Aitana
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdf
Aitana16 views
"Running students' code in isolation. The hard way", Yurii Holiuk by Fwdays
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk
Fwdays11 views
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely21 views
Unit 1_Lecture 2_Physical Design of IoT.pdf by StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 views
Voice Logger - Telephony Integration Solution at Aegis by Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma39 views
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi127 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson85 views
Serverless computing with Google Cloud (2023-24) by wesley chun
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)
wesley chun11 views

Transforming WordPress Search and Query Performance with Elasticsearch

  • 2. Who Am I? • My name is Taylor Lovett • Director of Web Engineering at 10up • Open source community member • WordPress core contributor • ElasticPress team member @tlovett12
  • 4. WordPress Search is Rudimentary • Only searches post title, content, and excerpt. • Relies on MySQL and thus is slow. • Relevancy calculations are poor and overly simplistic. • Not able to handle any advanced filtering.
  • 6. WordPress Complex Queries Are Slow • Querying for posts that contain multiple meta keys. • Querying for posts that contain multiple taxonomies.
  • 8. Elasticsearch • Open-source search server written in Java based on a technology called Lucene (open- source search software by Apache). • A standalone database server that provides a RESTful interface to accept and store data in a way that is optimized for search and multi- dimensional queries. • Extremely scalable, performant, and reliable
  • 9. Elasticsearch • Relevant results • Performant aggregation queries • Autosuggest • Fuzzy matching • Geographic searches and queries • Filterable searches and queries • Data weighting • Much more
  • 10. Get an Elasticsearch Server • Very flexible and customizable. There is not really a “one size fits all” setup. Generally, you have two options: • Option 1: Pay someone else to manage/host your Elasticsearch cluster (SaaS) • Option 2: Host your own cluster
  • 11. Elasticsearch SaaS • elasticpress.io • qbox.io • heroku.com • elastic.co
  • 13. ElasticPress ElasticPress is a fast and flexible search and query engine for WordPress.
  • 14. ElasticPress Features • Instantly find the content you’re looking for. The first time. Advanced relevancy algorithm which includes date weighting, term/meta searching, fuzzy matching, and more. • Search and query across multiple blogs in a multisite instance. • Extremely performant related content widget.
  • 15. ElasticPress Features • Dramatically improve performance of admin queries to assist editors in finding content. • Indexes text inside of popular file types (pdf, ppt, doc, etc), and adds those files types to search results. • Autosuggest for search - suggest relevant content as text is entered into the search field. • WooCommerce integration that improves faceting and product look up speed as well as order search in the admin.
  • 16. ElasticPress Requirements • WordPress 3.7+ • An instance of Elasticsearch.
  • 17. Installation • Github: http://github.com/10up/elasticpress • WordPress.org: http://wordpress.org/plugins/ elasticpress
  • 22. Query Integration new WP_Query( array(
 ’s’ => ‘search terms’,
 ‘author_name’ => ‘taylor’,
 …
 ) ); new WP_Query( array(
 ’ep_integrate’ => ‘true’,
 ‘author_name’ => ‘taylor’,
 …
 ) ); new WP_Query( array(
 ‘author_name’ => ‘taylor’,
 …
 ) );
  • 23. Advanced Query API • Search taxonomy terms • Filter by taxonomy terms (unlimited dimensions) • Search post meta • Filter by post meta (unlimited dimensions) • Search authors • Filter by authors • Search across blogs in multisite • Complex date filtering • more!
  • 24. Example Queries new WP_Query( array(
 ’s’ => ‘vienna austria’,
 ‘sites’ => ‘all’,
 ) );
  • 25. Example Queries new WP_Query( array(
 ’s’ => ‘vienna austria’,
 ‘search_fields’ => array(
 ‘post_title’,
 ‘post_content’,
 ‘taxonomies’ => array( ‘category’ ),
 ),
 ) );
  • 26. Example Queries new WP_Query( array(
 ’s’ => ‘vienna austria’,
 ‘post_type’ => ‘page’,
 ‘author_name’ => ‘taylor’,
 ‘search_fields’ => array(
 ‘post_title’,
 ‘post_content’,
 ‘meta’ => array( ‘city_name’ ),
 ),
 ) );
  • 27. Example Queries new WP_Query( array(
 ’s’ => ‘vienna austria’,
 ‘tax_query’ => array(
 array(
 ‘taxonomy’ => ‘category’,
 ‘terms’ => array( ‘term1’, ‘term2’ ),
 ),
 ),
 ‘search_fields’ => array(
 ‘post_title’,
 ‘post_content’,
 ‘meta’ => array( ‘city_name’ ),
 ‘author_name’,
 ),
 ‘site’ => 3,
 ) );
  • 28. Example Queries new WP_Query( array(
 ‘ep_integrate’ => true,
 ‘tax_query’ => array(
 array(
 ‘taxonomy’ => ‘category’,
 ‘terms’ => array( ‘term1’, ‘term2’ ),
 ‘operator’ => ‘or’,
 ),
 array(
 ‘taxonomy’ => ‘custom_tax’,
 ‘terms’ => array( ‘customterm1’ ),
 ),
 array(
 ‘taxonomy’ => ‘post_tag’,
 ‘terms’ => array( ‘tag1’ ),
 ),
 ‘relation’ => ‘OR’,
 ),
 ) );
  • 29. Example Queries new WP_Query( array(
 ‘ep_integrate’ => true,
 ‘meta_query’ => array(
 array(
 ‘key’ => ‘city_name’,
 ‘value’ => ‘vienna’,
 ),
 array(
 ‘key’ => ‘number_key’,
 ‘value’ => 5,
 ‘compare’ => ‘>’,
 ),
 array(
 ‘key’ => ‘exists_key’,
 ‘compare’ => ‘exists’,
 ),
 ),
 ) );
  • 30. WP_Query Integration • We want to be able to run all (slower) WP_Query instances through Elasticsearch. • This means we have to support every query parameter which isn’t the case yet. Github contains a full list of parameters WP_Query supports with ElasticPress and usage for each parameter.
  • 31. ElasticPress in Your Language • ElasticPress is designed to be internationalized. • Out of the box, it will work fine with most languages.
  • 32. Analysis and Analyzers • When a document is indexed in Elasticsearch, text is analyzed, broken into terms (tokenized), and normalized with token filters. • In normalization, strings might be lowercased and plurals stripped.
  • 33. Custom Analyzers • ElasticPress by default uses a pretty standard set of analyzers intended for the English language. • We can easily customize our analyzers for use with other languages by filtering ep_config_mapping (see EP source code). • You can read about language specific analyzers here:
 
 http://www.elasticsearch.org/guide/en/elasticsearch/ reference/current/analysis-lang-analyzer.html
  • 34. Documentation Full documentation with installation instructions:
 
 https://github.com/10up/ElasticPress
  • 35. Feedback and Continuing Development • If you are using ElasticPress on a project, please let us know and give us feedback. • Pull requests are welcome!
  • 36. Questions? We need to send a PUT request to this endpoint with our post data. Of course we must authenticate before doing this. @tlovett12 taylor.lovett@10up.com http://elasticpress.io