A presentation at HYF Copenhagen by Alexander Reelsen
Introduction into Elastic App Search Alexander Reelsen Community Advocate alex@elastic.co | @spinscale
What is App Search?
App Search? Synonym management Relevance tuning Curated Results Facets Easy UI Building API driven indexing
App Search? Language Optimization Query suggestions Result suggestions API Logs Analytics: Queries, clicks, counts
Deployment Run locally Elastic Cloud
Synonym Management
Relevance Tuning Field weight Boost, also based on field values (think recency, proximity, rating boosts)
Relevance Tuning
App Search Clients JavaScript/Node PHP Python Ruby Search UI
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
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 } ]’
Knowledge Base Sample App Two components: web frontend, data importer Two engines: elastic-co-discuss , elastic-co-docs
Data Importer Elastic Cloud Web Frontend Import docs/discuss Query Suggestions/Results Return Suggestions/Results
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 .
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”
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
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
Demo
Demo Tasks Check out frontend Relevancy Synonyms Test UI builder
Summary Frontend: Presentation Middleware: Search logic Backend: Document actions
Next steps
App Search Docs
Discuss Forum
Free trainings
Get a free 30d trial https://ela.st/hack-your-future-2020
Q&A Alexander Reelsen Community Advocate alex@elastic.co | @spinscale Diagrams: unDraw
This is a high level introduction into Elastic App Search, that contains all the steps required to get up and running with App Search including a sample app with some sample data, which you can use to start off with and then tune your search results step by step.