Problem/Motivation

Auto-Suggest throws this error in Drupal logs:

Drupal\search_api_solr\SearchApiSolrException while fetching autocomplete suggestions: Solr endpoint https://searchcloud-2-us-west-2.searchstax.com:443/ not found (code:  
             404, body:                                                                                                                                                                 
               Searching for Solr?                                                                                                                                                      
               You must type the correct path.                                                                                                                                          
               Solr will respond.                                                                                                                                                       
                                                                                                                                                                                        
             , message: Solr HTTP error: OK (404)                                                                                                                                       
                                                                                                                                                                                        
               Searching for Solr?                                                                                                                                                      
               You must type the correct path.                                                                                                                                          
               Solr will respond.                                                                                                                                                       
                                                                                                                                                                                        
             ). in Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase->handleHttpException() (line 1152 of                                                                    
             /app/docroot/modules/contrib/search_api_solr/src/SolrConnector/SolrConnectorPluginBase.php).

This is likely because my Update API endpoint and my Auto-Suggest API live on different SearchStax servers:

SearchStax Update and Auto-Suggest APIs exist on different servers.

When configuring a server in Drupal Search API, we are only given the option to configure one endpoint (the Update endpoint). The Auto-Suggest endpoint is then apparently derived from the Update endpoint by piecing them together assuming that they live on the same server. As you can see this is not a safe assumption to make.

I have two different sites I'm moving to SearchStax from Acquia. On the first site, the Update and Auto-Suggest endpoints are on the same server and Auto-Suggest works. On the second site, the Update and Auto-Suggest endpoints are not on the same server and Auto-Suggest doesn't work and throws the error.

Steps to reproduce

Proposed resolution

Issue fork searchstax-3581963

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

maskedjellybean created an issue. See original summary.

maskedjellybean’s picture

I tried recreating the app in SearchStax but my Auto-Suggest API is still on a different server. This will definitely need to be fixed within this module.

drunken monkey made their first commit to this issue’s fork.

drunken monkey’s picture

Version: 1.10.0 » 1.x-dev
Priority: Normal » Major

Thanks for bringing this to our attention!
I’m in the process of developing a fix for this and will let you know once I have something to test.

drunken monkey’s picture

Status: Active » Needs work
Issue tags: +Needs tests

Update: There is now an MR which should fix this problem by switching the setting to “Auto-suggest endpoint” instead of core. Please try it out and tell me if this fixes the problem for you. Also see this change record for more information regarding the change.
But in principle you should only need to use the code in the MR, then execute the update hook and this should start working.

I still need to write test coverage for the new functionality, but once that’s there and pipelines are passing I will merge the MR to HEAD to be tested further there. Once everything is confirmed to be working I will create a new release 1.11.0 with this fix.

  • drunken monkey committed 26c1bdac on 1.x
    feat: #3581963 Added support for Auto-Suggest endpoints on different...
drunken monkey’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests

The MR was now merged to HEAD where it can be tested.

maskedjellybean’s picture

It worked! Thank you!

drunken monkey’s picture

Status: Needs review » Fixed

Great to hear, thanks for testing.
This is now part of the new 1.11.0 release.
Thanks again!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.