Sign in
Log inSign up
Ease your life with Elastic App Search

Ease your life with Elastic App Search

Jayesh Bapu Ahire's photo
Jayesh Bapu Ahire
·Mar 27, 2020

Whenever you come across a word search what are the things come in your mind? You might think of Google Search, search for any particular object around you, searching for a particular product on Amazon... etc. When we say search we can observe that in today's digital world, there are many novel ways people are using search as a service.

But, What is Search?

Search in our case is looking in (a database or the World Wide Web) using various algorithms for the systematic retrieval of information.

So, If you have noticed nearly every app you are using or website you are browsing has it's own search bar which uses various services to provide you a way to systematically extract the required information which involves things like sorting, filters, keyword matching etc.

Now consider you want to build a search engine for your web-app. How complicated that task will be? Here, Elastic App Search comes into picture to ease your life.

What is App Search?

App Search is a search-as-a-service solution designed to simplify the process of building rich, user-facing search experiences. It leverage the incredible power of Elasticsearch and focuses squarely on powering search experiences in software applications of every kind — from ecommerce websites, to SaaS applications and mobile apps.

What are the key benefits?

What are the additional things you get with App Search apart from plug and play solution? Developers using App Search are able to build search experiences much faster, due to three key factors:

  1. Simple Implementation: features such as schemaless indexing and built-in typo tolerance, in conjunction with a library of first-party API Clients, enables developers to be up-and-running in minutes.
  2. Cloud-Based SaaS Model: no need for on-premise deployment, infrastructure provisioning, or long-term maintenance. Simply create an account and get started immediately.
  3. Seamless Scalability: App Search is designed to scale seamlessly and painlessly as your usage increases.

Let's explore App Search and find more about it: You can setup app search using following steps.

Step 1: Creating App Search Deployment:

There are two ways to do this:

  1. You can go on switype website and sign up for free trial.

Below is the screenshot of how it looks:

Alt Text

After signing up you will be redirected to normal on-boarding process where you can create new engine if you want else they have demo engine setup for you on dashboard which uses national park datasets. You can explore the functionality using that!

Alt Text

  1. Second way will be using Elastic Cloud hosted App Search deployment. Which you can do from elastic cloud console with few clicks as shown below. You can avail 30 days free trial by signing up here.

Alt Text

Now, We will be using App Search deployment on elastic cloud for demo though it doesn't really matter as both will be offering same features.

Alt Text

Step 2: Create an Engine

You can create new engine from app search dashboard. To create an engine, locate and click the “Create an Engine” button from your account home page. An engine in App Search is analogous to an index in Elasticsearch. It serves as a container for the documents you index, dataset- level configurations such as weights and boosts, as well as the search analytics that App Search automatically collects for you as users perform searches on the content in that index.

Alt Text

Step 3: Indexing Documents

Once you create engine you will get an option to index documents as shown below.

Alt Text

Alt Text

There are three ways to send documents to your Engine for indexing. You can paste raw JSON, upload a .json file, or POST to the Documents API endpoint.

You have to get your API credentials from credentials tab to use third method.

Alt Text

The Documents API can be used to add new documents to your Engine, update documents, retrieve documents by id, and delete documents. There are a variety of client libraries to help you get started.

To see the API in action, you can experiment with the example request available on dashboard.

For the movies dataset we will be using it looks like below:

curl -X POST 'host-7s23ap.api.swiftype.com/api/as/v1/eng… \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-3958sdlfjadsf' \
-d '[
    {
      "title":"An Innocent Magdalene",
      "year":1916,
      "cast":["Lillian Gish","Spottiswoode Aitken"],
      "genres":["Drama"]
    }
  ]'

step 4: Let's test our engine

Again there are multiple ways to test your engine. We will be using readily available query tester from App Search Dashboard. This is how it looks:

Alt Text

Alt Text

Now we know how to create an App Search engine. Let's explore various features elastic app search offers us:

  1. Robust APIs: As we saw above we can use powerful, adaptable, intuitive APIs for indexing, searching, managing our search engine and lot more.

  2. Language clients: Just index your data using one of the well-maintained API clients — spanning multiple languages and platforms. And easily add search using Search UI.

While creating engine we can choose from number of languages available else we can keep it universal. This provides the essential robustness to this service and this brings us to our third feature.

  1. Language-optimized engines: We can implement search specifically tuned for a variety of different languages.

Alt Text

  1. Reference UI: App Engine provides you a functionality to create reference UI as below so you can test how search will look in case of your application. It's downloadable React application which you can tweak according to your requirements and directly use in your web-app or e-commerce application.

Alt Text

Alt Text

  1. Powerful relevance: help us to take advantage of typo-tolerance, bi-grams, stemming, and more, right out of the box. you can see this features below:

Alt Text

Alt Text

  1. Real-time analytics: Leverage invaluable insight into user behavior to curate a better search experience. Analytics plays a very important role if you are implementing this service for any business as that gives you an understanding of user requirements. Analytics comes handy though use of this data varies as per industry or use case.

Alt Text

  1. Curated search: We can use weights, boosts, and synonyms to make the search experience unique to your application. You can observe this in movie-search engine we have created below.

Alt Text

  1. synonyms: App engine provides us an option to set synonyms as well. Which helps to provide robust search results.

Alt Text

Alt Text

Here's the link to movies dataset I used in case you want to explore more: raw.githubusercontent.com/prust/wikipedia-…

What's next?

Isn't this interesting and super cool? It's the easiest way to Search through any data from any application using any interface. So what you are planning to build with this? Let me know in the comments. The only limit is your imagination. If you have any questions you can hit me up on twitter!

References:

  1. Switype App Search Documentation: swiftype.com/documentation/app-search/gett…
  2. Elastic Blog: elastic.co/blog/elastic-app-search-is-now-…
  3. Elastic Blog on GA: elastic.co/blog/elastic-app-search-now-ava…
  4. Dataset: github.com/jdorfman/awesome-json-datasets
Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct