Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Using & Extending Search API With Plugins - DrupalCamp London 2019

Using & Extending Search API With Plugins - DrupalCamp London 2019

E699d3eb01633cd53d59cdd28c1c252d?s=128

Mohit Aghera

March 03, 2019
Tweet

Transcript

  1. 1 axelerant.com Using & Extending Search API With Plugins Mohit

    Aghera (mohit_aghera)
  2. 2 axelerant.com Mohit Aghera Drupal developer @Axelerant Drupal.org: mohit_aghera Twitter:

    @mohit_rocks
  3. 3 axelerant.com Content is the reason Search began in first

    place - @leeodden
  4. 4 axelerant.com Search API Ecosystem • Search API • Solr

    Search • Database Search • Facets API • Search Autocomplete • Search API Ranges
  5. 5 axelerant.com Search API Architecture Holds storage mechanism What to

    search and how to Search API Server Central configuration to hold field and related index data Backend Independant Search API Index Views, Facets Backend independant Consumers Tells what to index and How to index Uses to render search results
  6. 6 axelerant.com Search API Backend • Specify type of server

    • Specifies how data will be indexed and used • Solr servers, Mongo DB servers, Xapian servers
  7. 7 axelerant.com Other Important aspects • Indexes • Field •

    Property • Datatype • Processor
  8. 8 axelerant.com Search API Indexes Data Source • Types of

    items • Nodes, users etc. Fields Processors Indexes • Properties to be searchable • Full text, filtering, sorting • Modify indexing and searching Process
  9. 9 axelerant.com Demo

  10. 10 axelerant.com Facets • Dynamically filtering results • Provides widgets

    and types • Range widgets • Checkbox widgets • And many more..
  11. 11 axelerant.com Demo

  12. 12 axelerant.com Facet API and widgets • Use cases like

    where we need to provide custom ranges • Provide text field to filter results
  13. 13 axelerant.com Building custom Facet widgets • Extends “WidgetPluginBase” •

    Override “build()” method • Take care of “getQueryType()”
  14. 14 axelerant.com Code !!!

  15. 15 axelerant.com Demo

  16. 16 axelerant.com DIY https://github.com/mohit-rocks/drupal8-um ami-search

  17. 17 axelerant.com Thank you!!