Finding relevancy Improving your application search bar! Alexander Reelsen alex@elastic.co | @spinscale

Today’s goal Learn about search, relevancy and the user perspective!

The ultimate search experience

The ultimate search experience: Query intent stock crash 2008 tomorrow’s temperature barack obama age twitter cheap nike hoodie red xl

The ultimate search experience: Query intent Extremely generic Rarely needed for most web applications Many search use-cases are specialized E-Commerce News Social network

E-Commerce Start with a full text search

E-Commerce Start with a full text search Drill down via facetted navigation

E-Commerce Start with a full text search Drill down via facetted navigation Select product

The ultimate search experience: Commercial Intent Scoring is never neutral, influencing factors (E-Commerce) Popularity Profit Availability Previous searches Previous purchases Cross/Upselling products

LinkedIn Search Search for first name Search for last name Prefix search 1st degree > 2nd degree 2nd degree > 3rd degree

LinkedIn Search Rare surname more important than first name

Let’s build such a person search using Elasticsearch!

Product Overview

Elastic Stack

Elasticsearch in one minute Search Engine (FTS, Analytics, Geo), near real-time Distributed, scalable, highly available, resilient Interface: HTTP & JSON

Sample app: Social network Entity: Person Fields: Matching: First & last name Scoring: Employer & direct contacts Meta: Title & image

Sample app: Social network { } “name” : { “last” : “Reelsen”, “first” : “Alexander” }, “employer” : “Elastic”, “title” : “Community Advocate”, “image” : “1”, “contacts” : [ “philippk”, “philipk”, “philippl” ]

Demo

Run node application git clone https://github.com/spinscale/social-network-search-sample cd social-network-search-sample npm install # create static build npm run build npm run start # or for development mode w/ livereload npm run build

Install Elasticsearch # https://www.elastic.co/downloads/elasticsearch wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.3-darwin-x86_64.tar.gz # wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.3-linux-x86_64.tar.gz # wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.3-windows-x86_64.zip tar zxf elasticsearch-7.9.3-darwin-x86_64.tar.gz cd elasticsearch-7.9.3 ./bin/elasticsearch

Install Kibana # https://www.elastic.co/downloads/kibana wget https://artifacts.elastic.co/downloads/kibana/kibana-7.9.3-darwin-x86_64.tar.gz # wget https://artifacts.elastic.co/downloads/kibana/kibana-7.9.3-linux-x86_64.tar.gz # wget https://artifacts.elastic.co/downloads/kibana/kibana-7.9.3-windows-x86_64.zip tar zxf kibana-7.9.3-darwin-x86_64.tar.gz cd kibana-7.9.3 ./bin/kibana Point your browser to http://localhost:5601/

Summary Coming up with a simple query is easy Figuring out user intents is hard Coming up with a proper query will take time and tries Analytics & metrics are vital

Next steps rank_feature : Boost score based on numeric field value vector : Similarity search based on a feature vector

Can you quantify search experience

How to measure search improvements

Continuous feedback loop

Thanks for listening Q&A Alexander Reelsen Community Advocate alex@elastic.co | @spinscale

Resources GitHub Sample Repo rank_feature field type documentation vector field type documentation search_as_you_type field type documentation

Community & Meetups https://community.elastic.co

Discuss Forum https://discuss.elastic.co

Thanks for listening Q&A Alexander Reelsen Community Advocate alex@elastic.co | @spinscale