Build app search experiences without architectural complexity using MongoDB Atlas Search

Siddharth Kothari
All things #search
Published in
4 min readNov 30, 2021

--

Demo of app search built with ReactiveSearch UI components and powered by MongoDB Atlas Search, try the live demo over here

Introduction

Search engines have become essential components for almost every user-facing application. For retailers, search results and recommendations directly drive revenue — since they enable users to find products fast, discover new products they hadn’t previously considered, all while offering businesses opportunities to better understand each customer and deepen engagement.

Being able to tailor experiences unique to a user’s search preferences, in order to surface more relevant content to them, is especially important for social media, digital media and e-commerce apps. For example, if I search for houseplant care videos on TikTok, I’ll be more likely to receive those types of recommendations moving forward.

Key Problems with Building App Search Today

The majority of search experiences built today are powered by bolt-on search solutions like Elasticsearch, Solr, or Algolia.

Because of the bolt-on nature of search solutions that are prevalent today, the total cost comes down to much more than the sticker price of the solution itself. The primary costs come from the ongoing operational overhead of maintaining the data sync pipeline and search infrastructure, the learning curve associated with the solution, and the development effort that goes into building and maintaining search interfaces.

A bolt-on solution requires syncing data (replicating, maintaining consistency and policies to age data out) between your operational database and your search engine — this is undifferentiated work that slows down productivity of your development teams.

Maintaining different technologies to satisfy speed and relevance requirements means more overhead, learning curves and resource specialization needed to have people use and manage different technologies, e.g. a team may choose the operational database functionality for exact match use cases, a full-text search engine to power a website search bar, and a specialized search engine for an internal knowledge base portal.

Search interfaces are notoriously hard to build as they sit at the intersection of design, data, relevance, and high performance. Take something that is as simple as a type-ahead or autocomplete UI.

Autocomplete done right should show relevant suggestions instantly from the first keystroke. Search-as-you-type experiences for popular consumer search sites further leverage telemetry data to show relevant suggestions that are also popular with other users, or take a user’s own past searches into consideration to personalize suggestions. It also needs to consider the design differences inherent to a mobile form factor as compared to a web device.

Problems similar to this apply to the entire search interface: whether it’s detecting search intent (e.g. applying a facet criteria based on user search), merchandising search results, rolling out search relevance strategy changes based on A/B tests, or providing telemetry feedback on user actions.

While getting these problems right can have an invaluable impact, they can often contribute to weeks and months of undifferentiated development/maintenance efforts.

MongoDB Atlas Search: A New Full-Text Search Solution

MongoDB Atlas Search makes it easier for organizations to integrate powerful full-text search capabilities into applications while minimizing backend complexity. Because Atlas Search is fully integrated with MongoDB Atlas, the global multi-cloud database service, there’s no need to replicate data and manage distinct data environments to add search functionality to your app. You have a single system of record and you can avoid setting up, maintaining, and scaling a separate search platform.

Atlas Search works by embedding an Apache Lucene engine on each node of a MongoDB Atlas cluster, and is designed to be simple to use without any extra infrastructure setup involved. You define the field mappings and index options for the documents in a collection, then Atlas Search will index the data and make it available for relevance-based search. Once data is indexed by Atlas Search, you can build search queries using the MongoDB aggregation pipeline. You use the same drivers and query syntax as the database, unifying the developer experience to eliminate context switching between two totally different technologies.

Atlas Search has dozens of search operators you can use to refine your results and craft complex search logic — like autocomplete, filters, and scoring — within a single search operation. Atlas Search also recently introduced Lucene-powered facets in public preview, making faceting and counting 100x faster than before!

With the ReactiveSearch MongoDB Realm project, developers can also create powerful search UIs using the ReactiveSearch and Searchbox UI kits available in React, Vue, JavaScript and React Native. It brings down the time to build consumer-grade search experiences from weeks and months to just days, leaving more time for your development teams to do differentiated work.

The ReactiveSearch UI kit from appbase.io has been used by over a thousand projects to create search UIs for marketplaces, aggregators, SaaS dashboards, and e-commerce storefronts. It comes with over 20 pre-built UI components for search boxes, a variety of list and range facets, results, and maps, or can be integrated with your own design components.

Here’s an app search experience built in ~80 lines of code using ReactiveSearch.

Check out more search UI component demos for numeric and text facets, search-as-you-type experiences, and geo search in React and Vue over here.

Start Building a Better App Search Experience

Sign up for MongoDB Atlas today to start simplifying your application stack. You can try Atlas Search with sample datasets on a free-forever cluster first, then upgrade when you’re ready to power your production applications.

Follow this getting started guide for a guided walkthrough on creating an end-to-end search experiences, or visit the Atlas Search Docs for in-depth references and guides.

--

--