Jump to content

Search Bar Not Working

Recommended Posts

I have good news and bad news.

The good news:

I have found that Microsoft offers a very good and inexpensive search. You can put it together and add java script to a Squarespace site using the Code Block. Works great after a couple of days of testing. Unlike Google, it's ad-free. Works great on the test.

Try it here: https://wtgpoa.org/test  (password: search)

Try "park" and "fences" and "bears"

Here a link that introduces it. It seem this has been around for a couple of years.

https://www.microsoft.com/en-us/bing/apis/bing-custom-search-api

https://blogs.bing.com/Developers-Blog/2018-04/bing-custom-search-build-a-customized-site-search-experience-in-just-a-few-minutes

The bad news:

It's Microsoft.

1. It is very inexpensive, I think. I cannot tell you exactly what it cost. Microsoft's Azure pricing on it's service, but especially so on this, is very complicated. (Tip: The vast majority of Squarespace users would probably sign up for what the call "Pay as You Go.")  Here's not very useful link:
https://www.microsoft.com/en-us/bing/apis/pricing

2. Microsoft's UI for setting this up is a nightmare. Know a bit of coding isn't going to help you much. The toss around labels such as "Endpoint," "Keys" and "Instances." There is no "done" when you're done. There is a ton of reading they want you to do.

3. You have to set up a Microsoft account and get into Azure. Big deal? Well, good luck finding custom search when you sign in. It's all of Azure. It's one for dang thing to manage. Use the links above.

So, am I going to use it? Maybe. It's the client's call and I'll have them test it. They're going to love it and the cost will not bother them. But, I'm a set-up and leave guy. I don't offer much support afterwards. I provide them with names of Squarespace shops who will help. But, they aren't going to know this Microsoft package, so the client will be taking a risk. I'm still thinking about what I'm going to recommend.

Thought?

Link to comment
  • 4 weeks later...

A couple disclaimers before the post:

 

1. I do not know how to code. Everything was done by following different guides and by brute force trial and error.

2. I’ll post the links to everything that helped me at the appropriate point in the guide.

3. Block out a few decent chunks of time to get this done. The guide will be broken up into sections, so the ‘breaks’ can be built in.

4. I made this because I’ve been looking for a solution to Squarespace’s search box issue for over a year [a lot of waiting and hoping they’d fix it], and I wish a had a step-by-step guide to walk me through fixing it myself. Really hope this helps.

 

Part 1 : Built Your Own Search Engine [see post above by ‘addcontext’]

 

1.  Create a Microsoft Account

2. Go to the website customsearch.ai

3. Follow this guide to built a search engine for your specific website: https://docs.microsoft.com/en-us/azure/cognitive-services/bing-custom-search/tutorials/custom-search-web-page

4. One thing I found unclear in the guide:

  • You can build and tinker with the search engine and see the search results it will provide for different searches in the ‘configurations' tab. However, it will not work on your site until you purchase/enter an activation key.
  • The simplest way to get the activation key:
    • At the bottom of the ‘configuration -> hosted ui’ tab on your search engine there will be a section called ‘subscription keys’
    • At the bottom of that section, there will be two links, ‘click to issue free trial key,’ ‘click to issue paid tier key.’
    • Either link will take you to portal.azure — you might have to sign in again with Microsoft account
    • It will ask you for a name, which subscription you want [can see a list of pricing here:https://www.microsoft.com/en-us/bing/apis/pricing]. Every option is relatively cheap, choose whichever works best for you.
    • For the section titled ‘resource group’ click ‘create new’ underneath — I just made it the name of my site.
    • Once you create it, you should be able to go to ‘Dashboard’ -> ‘Search’ [under 'All Resources’] -> ‘Keys and Endpoint’ [under 'research management'] -> Show Keys
    • Enter those keys for your subscription keys

 

 

Part 2 : Integrating the Search box onto your Website

 

If you only need the search box on a specific page: just follow step 1 -4 below. If you want the search bar at a specific part of EVERY page, keep going.

 

1. For the search engine you created, leave the ‘configuration’ tab and go to the ‘production’ tab.

2. You’ll be in a section called ‘Endpoints.’ Click the bottom tab in that section called ‘Hosted UI’

3. You’ll see some text followed by ‘option 1: Javascript snippet.’ Copy the full snippet in the grey box.

4. Go to your Squarespace Website and find the page you want your search box on.

  • Edit the page -> add element -> code [in the 'more' section]
  • Paste the code. KEEP THE CODE IN ‘HTML’ FORM, AND KEEP DISPLAY SOURCE UNCHECKED. While you are editing the site you won’t be able to see the search box, but if you open up a new browser and go to the site, it will be there.

 

 

Part 3: Getting the Search Box to the header of your website

 

Follow this guide for reference : https://www.will-myers.com/articles/adding-a-search-bar-to-your-header-in-squarespace-71

 

1. Add the code block to the footer of your website.

2. Find the ‘id’ of your code block [I’d recommend watching this whole video, but skip to 2:30 to see  https://www.youtube.com/watch?v=l-6CWVx2NW4&t=151s . If you don’t want to watch the video, follow these steps:

  • Open up a new browser window and go to your website.
  • Scroll to the footer of your website and right click on the search block and click ‘Inspect Element’ [this is at least how you do it on a Mac].
  • A bunch of developer code will pop up. You should see as your mouse passes over different code, that different sections of the site are highlighted. If you inspected your search box, the code pertaining to the box should be highlighted.
  • Move your mouse up the code until the element above the search box is highlighted. The first lines of code underneath should contain your box id. Looks something like  ‘block_yui_1234567890987654321.’ Copy that.

 

3. Go to the Code injection area of your website [Settings -> Advanced -> Code Injection].

 

In the header area, paste the following code [Again, I don’t know code. This was taken directly from https://www.will-myers.com/articles/adding-a-search-bar-to-your-header-in-squarespace-71, so again, props to him for creating this.]:

 

<script src="https://code.jquery.com/jquery-3.5.1.js"></script>

<script>

$(function(){

  let searchBlock = $(‘#BLOCK-ID-HERE)

  .attr('id', '')

  .addClass('header-search-bar');

  

$(searchBlock).insertAfter($(‘header-title-nav-wrapper’));

  $(searchBlock).clone().addClass('mobile-header-search-bar').appendTo($('[data-folder="root"] .header-menu-nav-folder-content'));

  })

 

</script>

 

4. Where it says ‘block-id-here’ in bold, paste your block id. Leave the ‘#’ in before your id.

5. Where it says ‘header-title-nav-wrapper’ in bold, insert the place you want your search bar to go. Again, this could take a little bit of work/trial and error. I found that when I put it underneath my navigation bar, the search wouldn’t work,  but when I put it underneath the site info, it would.

  • Same process as getting your block id. Inspect the element on your webpage you want the search bar to follow [I ended up using ‘div.site-info’ but I really couldn’t tell you what will work for your site.

 

 

Part 4: Edit the Search Box to Look nice

1. Go to Design -> CustomCSS

2. Follow the Code on https://www.will-myers.com/articles/adding-a-search-bar-to-your-header-in-squarespace-71 to make adjustments to the width of the box.

  • Two notes: the code on the website didn’t work for me until I replaced ‘input’ with ‘.bcs-container-searchbox’ [inspected the search box at the top of the page and used the class id.]. Also, you can change the '33%' to whatever you want to adjust the size of the box. 33% was just the size I chose to use :

 

.header-search-bar input{

margin-left: auto;

  width:33% !important;

}

 

3. The rest of the adjustments, you should be able to make on your customsearch.ai site under Configuration -> Hosted UI -> Configure Color Theme -> Search Box Configurations

 

 

Hope this helped! If you have any questions, I probably can’t answer them!

Link to comment

I'm having the same issue.  But Squarespace Help is telling me I need to remove all the custom code from my site before they can test it.  ("While you're welcome to use custom code to modify your site, sometimes it can interfere with Squarespace’s built-in code and cause unexpected errors. Can you temporarily remove any custom code from your site for testing purposes?") Have other people done that? I don't have a huge amount of custom code on my site but it's scattered over 500 pages and it would take me at least a day or two to remove it and then get it back up there properly (and what would the site look like during that time?) Is this a real thing or are they just kind of pushing me off?

It would be GREAT if this got solved by Squarespace, so it would great if people would up vote @CarrieT's original question. It would also just be great if they would reply to this thread with some possible options/work arounds while their engineers are at work. 

Thanks so much @NotACoder404 for taking @Addcontext's Microsoft Search bar idea and really spelling out how to do it. @Addcontext said they couldn't quote how much it cost to do this, but can you? Also, don't mean to be a pain, but can you add pictures of what your search bar looks like and what the results look like? (Not that I love Squarespace's Search results page... it looks pretty janky to my eye).

Link to comment
  • 6 months later...

 

On 6/9/2020 at 7:41 PM, CarrieT said:

Our search bar has not been working properly. I've reached out to Squarespace numerous times over the last few months about the issue.

This is a fairly old thread, but as new users continue to discover this issue and then read this thread, I thought it would be helpful to confirm that this is still an ongoing issue today (September 2021). 

As Squarespace said in their response to @CarrieT's ticket:

Quote

"I can confirm the issue you're seeing with the built-in search bar is due to an issue on our end. In this case, the issue is preventing partial phrases or keywords from returning results. In order to view a specific post in search results, the exact title needs to be entered." 

As fixing search is likely to involve a lot of engineering work, it's unlikely to be something that Squarespace can fix very quickly. You may not want to rely on the internal search feature, especially for the discovery of products on a site, as a valid search is likely to produce a "no results" answer when products exist.

If you want to improve product discoverability, it may be worth improving filtering and categorisation of products, rather than adding search.

For example, allowing users to filter by 'size', 'colour', 'brand' and so on, in addition to product categories like 'Dresses'. The Universal Filter plugin is amazing and can really help with this.

Alternative search products include:

  • Swiftype. This is one of the best available and is reassuringly expensive.
  • Google Custom Search. This is free but difficult to style and includes Google branding.

Did this help? Please give feedback by clicking an icon below  ⬇️

Edited by paul2009
Added URL

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment
  • 2 months later...
On 12/16/2020 at 12:03 PM, Addcontext said:

Quick view on search is not displaying results every time, I might even say "usually." What is working on my sites is turning off "quick view" (so that the user has to hit the return bar. Then I'm seeing results every time.  

search quick view checkbox.jpg

Thank you!! This seems to have fixed the inconsistent search for us (for now). This needs to be voted to the top, only mention online I can find that resolved this. A band-aid, unfortunately, but I'm glad visitors won't be frustrated by a broken search bar anymore.

Link to comment
  • 1 month later...
On 12/14/2021 at 4:18 PM, JohnHenry1 said:

Thank you!! This seems to have fixed the inconsistent search for us (for now). This needs to be voted to the top, only mention online I can find that resolved this. A band-aid, unfortunately, but I'm glad visitors won't be frustrated by a broken search bar anymore.

Hi,

Can you post where this option is, please? I've been looking all over (Brine) and can't locate it.

Thanks,

Patrick

Link to comment
46 minutes ago, patrickgilmour said:

Can you post where this option is, please? I've been looking all over (Brine) and can't locate it.

That feature is for Search blocks not the Search page.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

tl;dr - if you're seeing inconsistent results, it might be because you have a large number of pages in your SquareSpace site.

We were seeing inconsistent search results on our site. Sometimes we'd get results, other times with exactly the same search string we'd get no results.

I got on Live Chat with support and was able to demonstrate this so my ticket was elevated.

This morning I heard back from Support:

Quote

 

I'm following up regarding the issue you're seeing with the site search. I can confirm that this is an issue we're currently aware of and working to improve, though right now we don't have a timeframe of when this might happen.
 
Our search function has a time limit and after a few seconds it will time out. This means that on sites with a lot of content, the search may appear to return no results, when searching again will bring these up.
 
As your site has about 270 pages, you may see this time out for certain searches. Currently the best way to avoid this is to disable or remove pages you may not need on your site at the moment.

 

Hope this helps.

Link to comment

SS support said.

Quote

I can confirm that this is an issue we're currently aware of and working to improve, though right now we don't have a timeframe of when this might happen.

The search page not functioning correctly has been going on for ages so when SS says they don't have a timeframe. They really don't have a timeframe!

If you need to have a working search then you need to find non SS options.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • 2 weeks later...
  • 2 weeks later...
On 2/3/2022 at 9:45 AM, patrickgilmour said:

tl;dr - if you're seeing inconsistent results, it might be because you have a large number of pages in your SquareSpace site.

We were seeing inconsistent search results on our site. Sometimes we'd get results, other times with exactly the same search string we'd get no results.

I got on Live Chat with support and was able to demonstrate this so my ticket was elevated.

This morning I heard back from Support:

Hope this helps.

Thanks for sharing this - it's a bummer for us, but really glad to have this answer so we can finally 'close the book' on it for now. We'd been on and off trying to resolve this for a few months.

Link to comment

Update on the Microsoft search solution I reported on a year ago:

It's working great. The client loves it. They have three Squarespace websites themselves and the community they serve has others. The Microsoft product allows the users to search them all. And the cost has been just a few dollars a month. (I think about $7.) You can see the Microsoft search function in action here:

https://www.wtgpoa.org/search-wintergreen

Here's a new page to what they are now calling Bing Custom Search:
https://www.customsearch.ai/

 

Link to comment
  • 2 months later...
On 5/16/2022 at 6:42 PM, kesslerramirez said:

It's 2022 and this is still an issue (www.kesslerramirez.com). Two years and no solution? I don't use the search block, so the band-aid fix isn't applicable to me. My main search bar on my site is the issue - rarely returns results. I even have an issue searching for my own blog posts on the back end because it doesn't return any results most times.

What have people found to be the best solution to the above issue in 2022? Are there any updates from Squarespace about if this will ever be resolved internally? 

Link to comment
  • 2 months later...

Same thing is happening on my client's site. They have a large podcast database that people are paying to use. Now the Search function has stopped working and her customers are getting annoyed. 

This is very frustrating because I got the exact same response from SS in a chat yesterday that the person who wrote this post TWO years ago got.

SS is rolling out with all these "fancy" updates but cannot fix bugs that have been an issue for years. 

Link to comment
  • 6 months later...
6 hours ago, Hans-Peter said:

PLEASE fix this. 

Please contact Squarespace Customer Care directly. The forum community would love to help but we are unable to resolve this.

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment
  • 2 months later...

This is a HUGE bug that has been impacting my website for awhile now.. like since 2020!

It usually takes 3 tries to search for a topic before the correct results show up.

Screen Recording of it: https://www.dropbox.com/s/wsxcskzhd3ytyak/ScreenFlow.mp4?dl=0

I've contacted support many times and the result is always the same - something about how the devs are working on it.. how can something basic like searching inside a website not work?

I'm seriously considering leaving Squarespace and going to Wordpress if they can't fix this soon.

Link to comment
Quote

there are a few steps you can take to try and troubleshoot the issue.

These steps won't help because SS's search is fundamentally broken. Don't waste your time.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • 2 weeks later...

As of May 18 and a couple years after discovering the search bug, Squarespace still hasn't fixed this. 

Try it our for yourself, go to the search bar on your squarespace site and search for a common topic that you know your site covers, it'll come up blank.

So basically, visitors coming to your site can't search for anything or will think your site doesn't cover an important topic, when it does.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.