Forum Academy Marketplace Showcase Pricing Features

Search 2.0 - Summarizing what I've learned exploring Algolia

@chad - Check out the aloglia demo.

The pricing volume discount question you have is more about how do you construct the tables to do these calculations fast. Algolia forums have a number of e-commerce folks and someone there can likely provide you not just an opinion but an opinion based on their experience. If I were you, I’d ask your question there.

Perfect cheers

Super helpful!

  1. Sorting can be done within the dashboard itself. You can rank order how the results come back from any index.

  2. There are a number of filter types: https://www.algolia.com/doc/guides/searching/filtering/
    I think this is what you want.
    image

I’m still waiting on a response from my contact at Aloglia on whether it’s better to have a User with a list of brands IDs OR have a flat table of User-Brand. I’ll let you know what I hear.

I’m trying to show a number of “hits” let’s say 20 when the page is loaded and when you click “Load More” then I’d increase that state and it should show more data. However, for some reason this doesn’t work, any ideas?

index_v2’s show is a number of results that should be shown, if I replace it with a number then it works perfectly but not when I use a dynamic state. I set the state upon page load before running the javascript.

image

Good workaround.
If you have a data field name with a dash sign, if its quoted then it should parse to an object key, for example:

{unquoted_field: "some data", "quoted-field": "some more data"}

JSON requires all keys to be quoted, so I assume you are creating an object directly from pasted-in code?

JSON example …

{"my json-field quoted field": "some data", "field1": "got it"}

1 Like

Is the function init_search() defined on page load, or in a HTML element? If a HTML element, then at the time it runs it is likely to have a blank value for the custom state.

To make it more robust, pass the value that changes as a parameter to the init function when you run it …

definition:

function init_search(paramHitsPerPage) {
 ... same as you have except for
  hitsPerPage: paramHitsPerPage
  ...
}

On page load:

init_search(index_v2’s show)

@mishav, any updates on this? …I’ve heard from numerous people that are really eager for a more performant solution for repeating groups. If this will move the needle, which it seems to do, then I’m certain we can get the community to fully sponsor it without any trouble.

1 Like

Ready to sponsor/ chip in/ test on my end. :zap:

I’ve been on this page for the last hour playing with the search function. I’m in awe @mishav

4 Likes

Me too. This is the motherlode improvement.

This will definitely be something we explore.

FYI, I don’t think this was already mentioned, but it looks like Bubble actually uses Algolia for their reference guide search.

1 Like

It’s https://community.algolia.com/docsearch/

Not integrated with Bubble.

Hmmm, do you mean RG in general, with API results in general, or specifically with Algolia?

You’re right, there’s plenty of interest in the Algolia solution. I’ll put some thought into what would be useful, then we can put together a budget.

As part of this process, feel free to chip in with your usage scenarios, for example, something specific to your page and data, covering these topics:

RG Functionality: repeating group cell to give access to multiple returned values for arbitrary Bubble elements; provide custom element(s) to display or return values for use within the cell, or trigger a workflow on click, paging, etc.

Algolia Widgets: which ones will be useful straight away, search / filter / results.

Design: expose (some of) the HTML and CSS used for the widgets / custom elements.

I have just been playing with the demo.

Absolutely brilliant, where do I sign?

From my side, RG performance would be the main factor. Being able to load and view filtered lists with pagination is no. 1.

Finally getting back to this… Here’s the method to filter the results of instant search

Did you figure out how to make the eqv. of a RG where the user doesn’t do a search. Rather, on page load, a pre-defined query pulls data in from an index (as opposed to a search from from bubble’s db)?

@mishav -

How did you figure out this statement to hand the data to bubble?
image

In addition to enabling the user to do a search, I have a 2nd use case which is to replace some of our RGs. Rather than give the user a search bar, I want to either hide or use index.search to have a pre-fab search load on page load (… an RG without user search where the datasource is an algolia index).

I tried using your snippet for makeHits to move the results -> bubble elements, but it didn’t work. How did you figure out this code for instant search?

@feee - You may have solved the filter some time back, but just in case, here’s the answer.

Add filters line…
image

Then go into algolia and make this field one you can filter on.

Do you mean a hardcoded query? You can use the configuration widget for this … example on:

fixed search page

Remove the code that adds the searchbox widget, and instead add a configuration widget…

search.addWidget(
  instantsearch.widgets.configure({
    query: "zelda"
  })
);

Edit … I’d make it a parameter to the init function, or a constant defined near the top of the javascript.

Most of the widgets are displaying something, but I wanted to catch the data, so instead I used the connector to build a new widget.

Okay. That’s so much easier than what I’ve been up to :). I’ll do that. Thank you for the example.