Search API ecosystem in Drupal 8 Joris Vercammen | @borisson Site - - PowerPoint PPT Presentation

search api ecosystem in drupal 8
SMART_READER_LITE
LIVE PREVIEW

Search API ecosystem in Drupal 8 Joris Vercammen | @borisson Site - - PowerPoint PPT Presentation

Search API ecosystem in Drupal 8 Joris Vercammen | @borisson Site building https:/ /events.drupal.org/dublin2016/sessions/search-api-ecosystem-drupal-8 Search API Search API Solr Facets More addon modules Custom code


slide-1
SLIDE 1
slide-2
SLIDE 2

Search API ecosystem in Drupal 8

Joris Vercammen | @borisson

Site building

slide-3
SLIDE 3
slide-4
SLIDE 4

https:/ /events.drupal.org/dublin2016/sessions/search-api-ecosystem-drupal-8

slide-5
SLIDE 5
slide-6
SLIDE 6
  • Search API
  • Search API Solr
  • Facets
  • More addon modules
  • Custom code
slide-7
SLIDE 7
slide-8
SLIDE 8
slide-9
SLIDE 9
slide-10
SLIDE 10
slide-11
SLIDE 11
  • Search API
  • Search API Solr
  • Facets
  • More addon modules
  • Custom code
slide-12
SLIDE 12
  • Introduction
  • The big merge
  • Influences
  • Architecture
  • Demo
  • Open issues
slide-13
SLIDE 13
  • Introduction
  • The big merge
  • Influences
  • Architecture
  • Demo
  • Open issues
slide-14
SLIDE 14
  • 2010 (d7)
  • Generic and flexible search tools
  • Different data
  • Different search engines
  • Different types of user interfaces
slide-15
SLIDE 15
  • Build Views of your entities including advanced

features like

  • Keywords
  • Facets
  • Filters
  • Sorts
slide-16
SLIDE 16
  • Introduction
  • The big merge
  • Influences
  • Architecture
  • Demo
  • Open issues
slide-17
SLIDE 17
  • 3+ years in the making
  • Crowdfunding campaign
  • Google Summer of Code
slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20
slide-21
SLIDE 21
slide-22
SLIDE 22
  • Introduction
  • The big merge
  • Influences
  • Architecture
  • Demo
  • Open issues
slide-23
SLIDE 23

drupal.org

  • Issue queues are powered with Search API Drupal 7

using the MySQL backend.

slide-24
SLIDE 24

Community

slide-25
SLIDE 25
slide-26
SLIDE 26
  • Introduction
  • The big merge
  • Influences
  • Architecture
  • Demo
  • Open issues
slide-27
SLIDE 27
  • Search index
  • Search server
  • Search Display
slide-28
SLIDE 28
  • modules
  • search_api
  • search_api_db
  • search_api_db_defaults
slide-29
SLIDE 29
  • Introduction
  • The big merge
  • Influences
  • Architecture
  • Demo
  • Open issues
slide-30
SLIDE 30
slide-31
SLIDE 31

https://www.youtube.com/watch?v=hA1N6Xggth8

slide-32
SLIDE 32

https://www.youtube.com/watch?v=LKN-fv3juIg

slide-33
SLIDE 33
  • Introduction
  • The big merge
  • Influences
  • Architecture
  • Demo
  • Open issues
slide-34
SLIDE 34
  • Hierarchical entities [#2625152]
  • Overhaul / Improve administration UI [#2387893]
  • Improve Fields UI [#2641388]
  • Config overrides for search entities [#2682369]
  • Fix test fails on php5.x on testbot [#2784849]
  • Documentation and tests
slide-35
SLIDE 35
slide-36
SLIDE 36
  • Search API
  • Search API Solr
  • Facets
  • More addon modules
  • Custom code
slide-37
SLIDE 37
  • Introduction
  • Demo
slide-38
SLIDE 38
  • Introduction
  • Demo
slide-39
SLIDE 39
  • solarium
slide-40
SLIDE 40
  • Introduction
  • Demo
slide-41
SLIDE 41
slide-42
SLIDE 42
slide-43
SLIDE 43
slide-44
SLIDE 44
slide-45
SLIDE 45

https://www.youtube.com/watch?v=QAbnMCA2utI

slide-46
SLIDE 46
  • Search API
  • Search API Solr
  • Facets
  • More addon modules
  • Custom code
slide-47
SLIDE 47
  • Architecture
  • Demo
  • Todo
slide-48
SLIDE 48
  • Architecture
  • Demo
  • Todo
slide-49
SLIDE 49
  • Facet
  • FacetSource
slide-50
SLIDE 50
  • Processor
  • Widget
  • Url processor
slide-51
SLIDE 51
  • modules
  • Facets
  • Rest Facets
  • Core Search Facets
slide-52
SLIDE 52
  • Architecture
  • Demo
  • Todo
slide-53
SLIDE 53
slide-54
SLIDE 54

https://www.youtube.com/watch?v=31p77ka8Tws

slide-55
SLIDE 55
  • Architecture
  • Demo
  • Todo
slide-56
SLIDE 56
  • Implement pretty paths [#2677728]
  • Hierarchy [#2598304]
  • Bring facets up to date with Search API’s beta 1

[#2794745]

  • Create a date query type [#2611812]
  • Add a solid slider and range widget [#2755663]
  • Add current search block / search summary

[#2735891]

  • Documentation + tests
slide-57
SLIDE 57
  • Search API
  • Search API Solr
  • Facets
  • More addon modules
  • Custom code
slide-58
SLIDE 58
  • Search API
  • Beta 2
  • Search API Page
  • Alpha 11
  • Search API Solr
  • Alpha 6
  • Search API Sorts
  • Alpha 1
  • Elastic Search
  • Development version
  • Search API Autocomplete
  • Development version
  • Search API attachments
  • Alpha 4
  • Search API Exclude Entity
  • Development version
slide-59
SLIDE 59
  • Facets
  • Alpha 5
  • Facets pretty paths
  • Sandbox module available
slide-60
SLIDE 60
  • Search API
  • Search API Solr
  • Facets
  • More addon modules
  • Custom code
slide-61
SLIDE 61
slide-62
SLIDE 62
  • Search API Processor.
  • Drupal\search_api\Processor\ProcessorInterface
  • Settings
  • “ | ignore”
slide-63
SLIDE 63

<?php
 
 namespace Drupal\custom_code\Plugin\search_api\processor;
 
 use Drupal\node\NodeInterface;
 use Drupal\search_api\IndexInterface;
 use Drupal\search_api\Processor\ProcessorPluginBase;
 
 /**
 * Excludes unpublished nodes from node indexes.
 *
 * @SearchApiProcessor(
 * id = "ignore_nodes",
 * label = @Translation("Ignore nodes for custom rules"),
 * description = @Translation("Don't index nodes according to our custom rules."),
 * stages = {
 * "preprocess_index" = -50
 * }
 * )
 */
 class IgnoreNodes extends ProcessorPluginBase {
 
 /**
 * {@inheritdoc}
 */
 public static function supportsIndex(IndexInterface $index) {
 // Make sure that this processor only works on processors that have nodes
 // indexed.
 foreach ($index->getDatasources() as $datasource) {
 if ($datasource->getEntityTypeId() == 'node') {
 return TRUE;
 }
 }
 return FALSE;
 }
 
 /**
 * {@inheritdoc}
 */
 public function preprocessIndexItems(array &$items) {
 foreach ($items as $item_id => $item) {
 $object = $item->getOriginalObject()->getValue();
 
 // Our nodes have " | ignore" in the title when they should be ignored and
 // not indexed, this is hardcoded information because of the import from
 // the external datasource.
 if ($object instanceof NodeInterface) {
 if (strpos($object->getTitle(), ' | ignore') !== FALSE) {
 unset($items[$item_id]);
 }
 }
 }
 }
 }

slide-64
SLIDE 64 <?php
 
 namespace Drupal\custom_code\Plugin\search_api\processor;
 
 use Drupal\node\NodeInterface;
 use Drupal\search_api\IndexInterface;
 use Drupal\search_api\Processor\ProcessorPluginBase;


/**
 * Excludes unpublished nodes from node indexes.
 *
 * @SearchApiProcessor(
 * id = "ignore_nodes",
 * label = @Translation("Ignore nodes for custom rules"),
 * description = @Translation("Don't index nodes according to our custom rules."),
 * stages = {
 * "preprocess_index" = -50
 * }
 * )
 */


class IgnoreNodes extends ProcessorPluginBase {
 
 /**
 * {@inheritdoc}
 */
 public static function supportsIndex(IndexInterface $index) {
 // Make sure that this processor only works on processors that have nodes
 // indexed.
 foreach ($index->getDatasources() as $datasource) {
 if ($datasource->getEntityTypeId() == 'node') {
 return TRUE;
 }
 }
 return FALSE;
 }
 
 /**
 * {@inheritdoc}
 */
 public function preprocessIndexItems(array &$items) {
 foreach ($items as $item_id => $item) {
 $object = $item->getOriginalObject()->getValue();
 
 // Our nodes have " | ignore" in the title when they should be ignored and
 // not indexed, this is hardcoded information because of the import from
 // the external datasource.
 if ($object instanceof NodeInterface) {
 if (strpos($object->getTitle(), ' | ignore') !== FALSE) {
 unset($items[$item_id]);
 }
 }
 }
 }
 }
slide-65
SLIDE 65 <?php
 
 namespace Drupal\custom_code\Plugin\search_api\processor;
 
 use Drupal\node\NodeInterface;
 use Drupal\search_api\IndexInterface;
 use Drupal\search_api\Processor\ProcessorPluginBase;
 
 /**
 * Excludes unpublished nodes from node indexes.
 *
 * @SearchApiProcessor(
 * id = "ignore_nodes",
 * label = @Translation("Ignore nodes for custom rules"),
 * description = @Translation("Don't index nodes according to our custom rules."),
 * stages = {
 * "preprocess_index" = -50
 * }
 * )
 */
 class IgnoreNodes extends ProcessorPluginBase {
 
 /**
 * {@inheritdoc}
 */


public static function supportsIndex(IndexInterface $index) {
 // Make sure that this processor only works on processors that have nodes
 // indexed.
 foreach ($index->getDatasources() as $datasource) {
 if ($datasource->getEntityTypeId() == 'node') {
 return TRUE;
 }
 }
 return FALSE;
 }


/**
 * {@inheritdoc}
 */
 public function preprocessIndexItems(array &$items) {
 foreach ($items as $item_id => $item) {
 $object = $item->getOriginalObject()->getValue();
 
 // Our nodes have " | ignore" in the title when they should be ignored and
 // not indexed, this is hardcoded information because of the import from
 // the external datasource.
 if ($object instanceof NodeInterface) {
 if (strpos($object->getTitle(), ' | ignore') !== FALSE) {
 unset($items[$item_id]);
 }
 }
 }
 }
 }
slide-66
SLIDE 66 <?php
 
 namespace Drupal\custom_code\Plugin\search_api\processor;
 
 use Drupal\node\NodeInterface;
 use Drupal\search_api\IndexInterface;
 use Drupal\search_api\Processor\ProcessorPluginBase;
 
 /**
 * Excludes unpublished nodes from node indexes.
 *
 * @SearchApiProcessor(
 * id = "ignore_nodes",
 * label = @Translation("Ignore nodes for custom rules"),
 * description = @Translation("Don't index nodes according to our custom rules."),
 * stages = {
 * "preprocess_index" = -50
 * }
 * )
 */
 class IgnoreNodes extends ProcessorPluginBase {
 
 /**
 * {@inheritdoc}
 */
 public static function supportsIndex(IndexInterface $index) {
 // Make sure that this processor only works on processors that have nodes
 // indexed.
 foreach ($index->getDatasources() as $datasource) {
 if ($datasource->getEntityTypeId() == 'node') {
 return TRUE;
 }
 }
 return FALSE;
 }
 
 /**
 * {@inheritdoc}
 */
 public function preprocessIndexItems(array &$items) {


foreach ($items as $item_id => $item) {
 $object = $item->getOriginalObject()->getValue();
 
 // Our nodes have " | ignore" in the title when they should be ignored and
 // not indexed, this is hardcoded information because of the import from
 // the external datasource.
 if ($object instanceof NodeInterface) {
 if (strpos($object->getTitle(), ' | ignore') !== FALSE) {
 unset($items[$item_id]);
 }
 }
 }
 }


}
slide-67
SLIDE 67

Should I use these now?

slide-68
SLIDE 68
slide-69
SLIDE 69

Questions?

slide-70
SLIDE 70

JOIN US FOR CONTRIBUTION SPRINTS

First Time Sprinter Workshop - 9:00-12:00 - Room Wicklow2A Mentored Core Sprint - 9:00-18:00 - Wicklow Hall 2B General Sprints - 9:00 - 18:00 - Wicklow Hall 2A

slide-71
SLIDE 71

Evaluate This Session THANK YOU!

events.drupal.org/dublin2016/schedule

WHAT DID YOU THINK?