@ian11 , @drixxon , I just emailed you and all SciousSearch users instructions on making the switch to Omnisearch. Check em out and let me know if you have any questions!
thank you so much!
Iāve been using Omnisearch for a while now and am generally satisfied with its performance. However, Iām having trouble getting the group_by
function to work.
Implementing it as shown in the image throws the following error: OMNISEARCH ERROR: TypeError: can't access property "map", hits is undefined
. When I remove group_by
from the advanced options, the error disappears and the results are shown ungrouped. Despite the error, the network logs, as seen below, indicate that the search is being returned correctly, but the plugin isnāt recognizing it.
Hereās the rest of the visual element:


Could you help me resolve this issue @zelus_pudding?
Hey Mikolaj,
Thank you again for trusting us with your search - Iām sorry to hear youāve hit this snag. For starters, I want to make sure youāre on the latest version of Omnisearch. Most people are so next I want you to replace the ["*"]
with a spelled list of all of the columns you want to search. I think in your case you can replace that to something like ["Listing"]
⦠we do provide a superset of this list for you if youāre using the sync template (when you go to sync, itās provided in āstep 2ā of the sync flow) which you can copy and paste into this visual element field. That may not fix the issue but let me know how it goes and weāll go from there.
Hi, thanks for the quick response! Unfortunately, despite updating the plugin and changing the fields to search
, the element still throws an error. Notably, removing group_by
from the advanced options eliminates the error. This is odd because it was working fine a while back. I made some changes since and had to pivot to a different feature and I do not recall how it was set up previously
Dug up our old support chat and found this. Does this help?
Thank you for your patience Mikolaj, Iāve finally found time to revisit. I see several issues with your setup. First, you do not need to add a
*
as the search input. Doing so would literally search for the keyword*
. Instead, leaving it blank will return all search results. Next, you use["*']
as the fields to search. This is incorrect and instead you should list the fields you want to search by name (case sensitive). A list of fields is conveniently provided from the sync-search-template after you select the fields you want to sync. You can copy and paste that list into thefields to search
input. Thirdly, I believe you defined theadvanced options
incorrectly. As specified in the docs, this is supposed to be provided as a JSON dictionary (similar to the format of thesort by
input. As such, youradvanced option
should look something more like:{"group_by": "field1,field2"}
Revisiting the instructions provided was the first thing I did after Iāve re-encountered the problem. Regrettably, despite following them the issue persists. Itās worth noting that the error Iāve mentioned disappears after removing the advanced options.
Im getting an error in bubble when attempting to sync - āfailed to fetchā
@zelus_pudding will this work for apps on an agency plan? Iām getting the error failed to fetch whilst trying to sync to typesense.
Confirmed it wont. Is it possible to update the plugin so weāre able to handle the auth? When on agency plan bubble requires username and password to be set for run mode.
@mikolaj,
One last question before I DM you to investigate further, can you confirm that the fields youād like to group_by
are synced to Typesense as facets?
Even if they are, I believe this will still throw an error for you that Iāll need to resolve with a plugin update. With said update, Omnisearch would not be able to return the results in actual groups but we would be able to return the results as a flat list of ungrouped hits in the order they would have been if they were in groups. Is that acceptable for your purposes?
@ Mlewis2016,
Iām looking into the issue youāre running into - I know the source of the problem/failure scenario youāre describing and am looking into an effective workaround.
I do confirm the field is synced as facet:
I think we will be able to work with ungroupped hits if they are in correct order. This would be a big improvement:)
Thanks, Iāve changed plan now but will be good for the future. Another question, how do we control the style of the highlights?
Iām also facing an issue where, when you have highlights turned on, the search no longer searches all the fields listed, it only returns searches for the field which is in the highlighted setting. Removing the field from the highlight setting fixes the issue.
Looking to work through these issues today - will be in touch as soon as possible
Question for ya, @mikolaj - if you say itās acceptable to have the group_by
hits returned not as groups of hits, but a list of hits in the same order as if they had been grouped, then is that output not the same or as good as sorting your search results by the whichever key you wanted to group_by
?
Asking, because Iām looking at modifying the plugin to give you this preferred output but it seems to me like it can be accomplished using a sort parameter.
Another question, how do we control the style of the highlights?
@mlewis2016 As youāve likely noticed, highlights are returned and denoted using BBCode syntax - which is what Bubble uses for formatting rich text inputs. That means that matched/highlighted substrings are enveloped in [b]
and [/b]
tags. If you want to change the formatting of this, one option is to use regex to replace the occurrence of those tags with your preferred format tags. So if you wanted to highligh text by coloring it red, for example, you could regex replace the [b]
and [/b]
tags to [color=#fff]
and [/color]
, respectively. If thatās too restrictive for some reason, I could also expose the ability to set the highlight tags (returned from Omnisearch in the first place) in the advanced options.
Iām also facing an issue where, when you have highlights turned on, the search no longer searches all the fields listed, it only returns searches for the field which is in the highlighted setting. Removing the field from the highlight setting fixes the issue.
I think I understand the issue youāre running into. Itās not so much that searches are not being run against all fields, but that highlights are not being returned for all fields in records that matched a search? Did I understand that correctly? If so, what your describing is due to a limitation with Bubble⦠where we can really only return highlights for one field at a time. Let me know if I understood your situation correctly so I can follow up with some suggestions.
Iām trying to display the capacity of each listing based on the sum of its room capacities and then sort the listings by their total capacity. While you worked on a solution I gave sorting a try, but I couldnāt get it to work properly. I hope itās possible to make group_by working as initially intended with grouped hits. Iām afraid sorting might not be the workaround here
Out of curiosity - thinking of another approach⦠are you not able to create a total_room_capacity
field on your listing
and then sort by that? Itās pretty common to pre-compute values like this to improve search speed (regardless of if itās Bubble, Algolia or a SQL database powering the search). And in your case it seems like it could simplify things.
Yet another solution is that Iām working on creating an Omnisearch element that can return records straight from Algolia/Typesense (unlike our current element which uses Algolia/Typesense to perform the search and then fetches the matched records from Bubble). This approach comes with the following pros/cons. Letās start with the cons:
- Loses the ability to use bubbleās permissions.
- Requires using Bubble API connector to define the data that gets returned from the new visual element
- Is a little more work to set up.
Pros:
- More flexibly use the full results just as Algolia/Typesense natively provides them. So you could get that data āgrouped_byā exactly as youāve seen it in Chrome developer tools.
- You can still hide records by setting up your search filters correctly / judiciously selecting what fields to return.
- Does not consume any WU to search.
- Returns search results faster
Thanks, iāll try the regex method. For the other point, actually no. If I have field 1, 2 and 3 and have highlights off, it works as expected, if I turn highlights on, it no longer filters based on the search input. Once highlights is turned off, it works again. To summarise, filtering by the same search has different results based on whether highlights is turned on or not.