The state of Search API in Drupal 8 Joris Vercammen | @borisson | - - PowerPoint PPT Presentation

the state of search api in drupal 8
SMART_READER_LITE
LIVE PREVIEW

The state of Search API in Drupal 8 Joris Vercammen | @borisson | - - PowerPoint PPT Presentation

DRUPALCAMP GHENT 2016 GROW SOME IDEAS The state of Search API in Drupal 8 Joris Vercammen | @borisson | @dazzletheweb http://drupalcamp.be/node/86 Search API Search API Solr Facets More addon modules Custom code Search


slide-1
SLIDE 1

DRUPALCAMP

GHENT 2016

GROW SOME IDEAS

The state of Search API in Drupal 8

Joris Vercammen | @borisson | @dazzletheweb

slide-2
SLIDE 2
slide-3
SLIDE 3

http://drupalcamp.be/node/86

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

features like

  • Keywords
  • Facets
  • Filters
  • Sorts
slide-15
SLIDE 15
  • Introduction
  • The big merge
  • Influences
  • Architecture
  • Demo
  • Open issues
slide-16
SLIDE 16
  • 3+ years in the making
  • Crowdfunding campaign
  • Drupal Dev Days & Drupalcon sprints
  • Dedicated Sprint
  • Google Summer of Code
slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20
  • Apache Solr for Drupal 7 stays
  • Apache Solr for Drupal 6 is dead
slide-21
SLIDE 21
  • Introduction
  • The big merge
  • Influences
  • Architecture
  • Demo
  • Open issues
slide-22
SLIDE 22

drupal.org

  • Issue queues are powered with Search API Drupal

7 using the MySQL backend.

slide-23
SLIDE 23

Community

slide-24
SLIDE 24
slide-25
SLIDE 25
  • Introduction
  • The big merge
  • Influences
  • Architecture
  • Demo
  • Open issues
slide-26
SLIDE 26
  • Search index
  • Search server
  • Views / Search API Pages
  • Search Display?
slide-27
SLIDE 27
  • Introduction
  • The big merge
  • Influences
  • Architecture
  • Demo
  • Open issues
slide-28
SLIDE 28
slide-29
SLIDE 29

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

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

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

slide-42
SLIDE 42
  • Search API
  • Search API Solr
  • Facets
  • More addon modules
  • Custom code
slide-43
SLIDE 43
  • Architecture
  • Demo
  • Todo
slide-44
SLIDE 44
  • Architecture
  • Demo
  • Todo
slide-45
SLIDE 45
  • FacetManager
  • ::initFacets
  • ::alterQuery
  • ::build
slide-46
SLIDE 46
  • Processor
  • Widget
  • Url processor
slide-47
SLIDE 47
  • Architecture
  • Demo
  • Todo
slide-48
SLIDE 48
slide-49
SLIDE 49

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

slide-50
SLIDE 50
  • Architecture
  • Demo
  • Todo
slide-51
SLIDE 51
  • Implement pretty paths [#2677728]
  • Hierarchy [#2598304]
  • FacetSerializer has a hidden dependency on REST

module [#2775963]

  • Bring facets up to date with Search API’s beta 1

[#2794745]

  • Documentation + tests
slide-52
SLIDE 52
  • Search API
  • Search API Solr
  • Facets
  • More addon modules
  • Custom code
slide-53
SLIDE 53
  • Search API
  • Beta 1
  • 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-54
SLIDE 54
  • Facets
  • Alpha 4
  • Facets pretty paths
  • Sandbox module available
slide-55
SLIDE 55
slide-56
SLIDE 56
  • Search API
  • Search API Solr
  • Facets
  • More addon modules
  • Custom code
slide-57
SLIDE 57
slide-58
SLIDE 58
  • Search API Processor.
  • Drupal\search_api\Processor\ProcessorInterface
  • Settings
  • “ | ignore”
slide-59
SLIDE 59

<?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-60
SLIDE 60 <?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 based on custom rule.
 *
 * @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-61
SLIDE 61 <?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-62
SLIDE 62 <?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();
 if ($object instanceof NodeInterface) {
 if (strpos($object->getTitle(), ' | ignore') !== FALSE) {
 unset($items[$item_id]);
 }
 }
 }
 }


}
slide-63
SLIDE 63

Questions?

slide-64
SLIDE 64

DRUPALCAMP

GHENT 2016

GROW SOME IDEAS