This plugin is the easiest way to bring blazing fast search using Algolia into your Bubble app.
Your users almost certainly use at least one of YouTube, Amazon, and Facebook. An essential feature that these big websites share is great search. The reason they have great search is because they have hundreds (if not thousands) of people working on it full-time.
Because your users are constantly exposed to great search on these platforms, they expect to find it on every site and application that they use. But your company isn’t a search company: it doesn’t make sense for you to hire a dedicated team of developers to reinvent search.
Algolia provides software and tools to help you implement efficient, flexible, and insightful search on your sites and applications.
Algolia provides your users with a fast and rich search experience. Your Algolia search interface can contain a search bar, filters, infinite scrolling, query suggestions, sorting, refinements, etc. These help your users find what they’re looking for and discover new products.
Find more info about Algolia here.
Go to https://www.algolia.com and create an account
Navigate to your Algolia Dashboard and create a new index here:
3. Now you need to populate the newly created index with data. You can import your database data directly or use a sample dataset:
4. Go to API keys page and copy your Application ID and Search-Only API key.
Please do not use the Admin API Key and keep it secret.
Install the Advanced Algolia Search plugin. Paste your keys directly on the plugin page:
Now add the Algolia Search element into your app. Insert your Index name. For the Data type please choose Algolia (Search Result). This field is used internally by the plugin.
You are ready to make your first search!
Plugin provides you a very straightforward way to search the data. Just call the Search action (for example, when user clicked a search button or search input value changed):
String to search
Attributes to retrieve
Comma-separated values. Example: "name, description, price". Attributes are the field names in your data structure.
Page to retrieve (starting from 0)
Results per page
Number of records per page
Once Algolia returns the search results, you can access the Result shared state:
It provides you a set of fields:
Query processing time (ms)
Current page index (starting from 0)
Total pages number in the final result
Total number of found results
Number of results on the current page
field1 .. field20
Array of Strings
Requested data attributes (in the order defined by Attributes to retrieve field).
FieldN is an array of strings. For example:
field1 (id): ["123", "542", "941"]
field2 (name): ["iPhone", "Android", "Samsung"]
Therefore you can iterate over arrays to display your data in tables, Repeating Groups etc.
There are several ways to push your data to an Algolia index:
Using the Algolia dashboard by sending a JSON file.
Using a Plugin action "Send Data" as explained below.
From your workflow call the "Send Data" action
Provide the index name, your APP ID and Admin API Key
Provide the object fields (name, age and country in the example above)
The returned object has 2 fields: error (Yes/No) and message (text)