Introduction into Elastic App Search

A presentation at HYF Copenhagen in July 2020 in by Alexander Reelsen

Slide 1

Slide 1

Introduction into Elastic App Search Alexander Reelsen Community Advocate alex@elastic.co | @spinscale

Slide 2

Slide 2

What is App Search?

Slide 3

Slide 3

App Search? Synonym management Relevance tuning Curated Results Facets Easy UI Building API driven indexing

Slide 4

Slide 4

App Search? Language Optimization Query suggestions Result suggestions API Logs Analytics: Queries, clicks, counts

Slide 5

Slide 5

Deployment Run locally Elastic Cloud

Slide 6

Slide 6

Slide 7

Slide 7

Slide 8

Slide 8

Synonym Management

Slide 9

Slide 9

Relevance Tuning Field weight Boost, also based on field values (think recency, proximity, rating boosts)

Slide 10

Slide 10

Relevance Tuning

Slide 11

Slide 11

App Search Clients JavaScript/Node PHP Python Ruby Search UI

Slide 12

Slide 12

Indexing data Requires an Engine in App Search No schema definition required, everything is text by default Arbitrary JSON can be sent Field id is unique identifier

Slide 13

Slide 13

Indexing data curl -X POST ‘https://$HOST/api/as/v1/engines/$ENGINE_NAME/documents’ \ -H ‘Content-Type: application/json’ \ -H ‘Authorization: Bearer [PRIVATE_API_KEY]’ \ -d ‘[ { “id”: “first_document”, “description”: “Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor…”, “title”: “My first title”, “created_at”: “2020-10-10T12:34:56Z”, “size” : 25 }, { “id”: “second_document”, “description”: “Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor…”, “title”: “My second title”, “created_at”: “2020-10-10T00:00:12Z”, “size” : 67 } ]’

Slide 14

Slide 14

Slide 15

Slide 15

Knowledge Base Sample App Two components: web frontend, data importer Two engines: elastic-co-discuss , elastic-co-docs

Slide 16

Slide 16

Data Importer Elastic Cloud Web Frontend Import docs/discuss Query Suggestions/Results Return Suggestions/Results

Slide 17

Slide 17

Clone Repository git clone https://github.com/elastic/app-search-kb-demo cd app-search-kb-demo # this will take a bit… docker build —target frontend -t app-search-kb-demo/frontend . docker build —target dataimport -t app-search-kb-demo/dataimport .

Slide 18

Slide 18

Configure credentials export AS_BASE_URL=”https://fc12fb2325dd4945a0095d60577bfa00.app-search.us-east-1.aws.found.io” export AS_PRIVATE_API_KEY=”private-2mfghuirex81t5346879aw3n” export AS_SEARCH_API_KEY=”search-eirws4ynagfdhgeep63ywscd”

Slide 19

Slide 19

Import Data into Elastic Cloud export AS_BASE_URL=”https://fc12fb2325dd4945a0095d60577bfa00.app-search.us-east-1.aws.found.io” export AS_PRIVATE_API_KEY=”private-2mfghuirex81t5346879aw3n” export AS_SEARCH_API_KEY=”search-eirws4ynagfdhgeep63ywscd” # import data into Elastic Cloud, might take a few minutes docker run —rm —env AS_BASE_URL=$AS_BASE_URL \ —env AS_PRIVATE_API_KEY=$AS_PRIVATE_API_KEY app-search-kb-demo/dataimport

Slide 20

Slide 20

Start Frontend export AS_BASE_URL=”https://fc12fb2325dd4945a0095d60577bfa00.app-search.us-east-1.aws.found.io” export AS_PRIVATE_API_KEY=”private-2mfghuirex81t5346879aw3n” export AS_SEARCH_API_KEY=”search-eirws4ynagfdhgeep63ywscd” # import data into Elastic Cloud, might take a few minutes docker run —rm —env AS_BASE_URL=$AS_BASE_URL \ —env AS_PRIVATE_API_KEY=$AS_PRIVATE_API_KEY app-search-kb-demo/dataimport # start the frontend docker run —rm -p 5000:5000 —env AS_BASE_URL=$AS_BASE_URL \ —env AS_SEARCH_API_KEY=$AS_SEARCH_API_KEY app-search-kb-demo/frontend

Slide 21

Slide 21

Demo

Slide 22

Slide 22

Demo Tasks Check out frontend Relevancy Synonyms Test UI builder

Slide 23

Slide 23

Summary Frontend: Presentation Middleware: Search logic Backend: Document actions

Slide 24

Slide 24

Next steps

Slide 25

Slide 25

App Search Docs

Slide 26

Slide 26

Discuss Forum

Slide 27

Slide 27

Free trainings

Slide 28

Slide 28

Get a free 30d trial https://ela.st/hack-your-future-2020

Slide 29

Slide 29

Q&A Alexander Reelsen Community Advocate alex@elastic.co | @spinscale Diagrams: unDraw