Integration

Supercharge Bubble App Search with Xano | Fuzzy Search in Bubble

Summary

Are you building a Bubble application that needs to handle large amounts of data? Are you looking for ways to improve the search functionality and user experience? Look no further than Xano, a powerful no-code backend platform that can take your Bubble app to the next level. In this step-by-step guide, we'll show you how to integrate Xano with your Bubble app and implement lightning-fast, accurate fuzzy search.

What is Fuzzy Search?

Fuzzy search is an advanced search technique that goes beyond simple string matching. It allows for more flexible and forgiving searches, taking into account things like:

  • Normalization of words: Fuzzy search can match singular and plural forms, e.g., searching for "party" will also return results containing "parties."
  • Case insensitivity: Search queries are not case-sensitive, so "TOY STORY" and "toy story" will yield the same results.
  • Flexible expressions: Users can perform exact phrase searches, negations (exclude specific words), and more.

Compared to Bubble's native search, fuzzy search offers superior speed and accuracy, especially when dealing with large datasets.

Setting up the Example

For this guide, we'll use a simple Bubble app that allows users to search for movies. Our app contains around 45,000 movie records, with each record including the movie title and plot summary.

Here's what our Bubble app looks like:

  1. A heading and an input field for users to enter their search query.
  2. Two repeating groups: one to display search results from Xano, and the other to display results from Bubble's native search.

We've already set up the Xano integration using the API Connector plugin. The plugin calls an API endpoint in Xano, which queries our movie database using the fuzzy search feature.

Step 1: Add Movie Data to Xano

The first step is to add your movie data to the Xano database. Here's how:

  1. Log in to your Xano account (or create a new one if you haven't already).
  2. Click on "Data" in the left sidebar, then click "Create Table."
  3. Name your table (e.g., "Movies") and add the necessary fields (e.g., "Title," "Overview").
  4. Import your movie data into the table using the "Import Data" option.

Step 2: Create a Search API Endpoint in Xano

Next, we'll create an API endpoint in Xano that will handle the search functionality:

  1. Click on "APIs" in the left sidebar, then click "Create API Endpoint."
  2. Give your endpoint a descriptive name (e.g., "Search Movies").
  3. In the endpoint editor, select your movie table as the data source.
  4. Use the search query parameter to filter the results using the fuzzy search feature.

Here's an example of what your API endpoint code might look like:

javascript param :query search :data.movies where title ~= :query || overview ~= :query return

This code searches the "title" and "overview" fields of the "movies" table using the fuzzy search operator `~=`. The `||` operator allows us to search across both fields simultaneously.

Step 3: Create an Index in Xano

To ensure optimal search performance, we'll create an index in Xano for the fields we want to search:

  1. Click on "Data" in the left sidebar, then select your movie table.
  2. Click on "Indexes," then "Create Index."
  3. Select "Search Index" as the index type.
  4. Choose the fields you want to index (e.g., "Title" and "Overview").
  5. Optionally, set the priority for each field (lower numbers have higher priority).
  6. Click "Save" to create the index.

Creating an index can take a few seconds or minutes, depending on the size of your data.

Step 4: Integrate Xano with Bubble

Now that we've set up the necessary components in Xano, let's connect it to our Bubble app:

  1. In your Bubble app, open the workflow editor for the input field where users enter their search query.
  2. Add an "API Connector" step and configure it to call the "Search Movies" API endpoint you created in Xano.
  3. Pass the user's search query as a parameter to the API endpoint.
  4. In the repeating group designated for Xano search results, set the data source to the output of the API Connector step.

That's it! Your Bubble app is now integrated with Xano's powerful fuzzy search capabilities.

Testing and Comparison

Time to see the difference between Bubble's native search and Xano's fuzzy search in action. Enter a search query (e.g., "toy story") in your Bubble app and observe the following:

  1. Speed: Notice how much faster Xano's search results populate compared to Bubble's native search, especially with large datasets.
  2. Accuracy: Xano's fuzzy search returns more relevant and accurate results, taking into account plurals, case insensitivity, and flexible expressions.

While Bubble's native search is adequate for smaller datasets, Xano's fuzzy search truly shines when dealing with large amounts of data, providing a superior user experience in terms of speed and accuracy.

Conclusion

By integrating Xano with your Bubble app, you can supercharge your search functionality and provide your users with a lightning-fast and accurate experience, even when dealing with massive datasets. Fuzzy search, combined with Xano's powerful backend capabilities, opens up a world of possibilities for your Bubble applications.

If you have any questions or need further assistance, feel free to reach out to the Xano community at community.xano.com or visit the link in the video description. Happy building!

This transcript was AI generated to allow users to quickly answer technical questions about Xano.

Was this helpful?

I found it helpful

I need more support
Sign up for XanoSign up for Xano

Build without limits on a secure, scalable backend.

Unblock your team's progress and create a backend that will scale for free.

Start building for free