I was able to successfully connect to search stax on my staging server. Started by migrating the search server, then the search index and then my two search views.

My first view is a normal /search page. That works and is pulling results from search stax. The second search view is what I use for autocomplete. I noticed on the autocomplete admin tab "/admin/config/search/search-api/index/searchstax_index/autocomplete", my view was no longer checked and the "operations" are gone.

Here is what stage looks like after migrating the view:

And here is prod:

When I attempt to select the "Acquia Solr Search Autocomplete" and hit save, I get a WSOD with this error in the dblog:

Drupal\search_api_autocomplete\SearchApiAutocompleteException: Attempt to save autocomplete search 'acquia_solr_search_autocomplete_1' with search plugin 'views:acquia_solr_search_autocomplete' when this plugin is already used for 'acquia_solr_search_autocomplete' in Drupal\search_api_autocomplete\Entity\Search->preSave() (line 418 of /var/www/html/docroot/modules/contrib/search_api_autocomplete/src/Entity/Search.php).

Any ideas?

CommentFileSizeAuthor
stage.png28.24 KBrondog469
prod.png33.48 KBrondog469

Issue fork searchstax-3554080

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

rondog469 created an issue. See original summary.

rondog469’s picture

Alright so I was able to get pass the WSOD. My first attempt to fix this was to rollback the "switch index of search views". After that, I went to my original index and just unchecked what you see in that screenshot on prod and save. Then I went back to the migrate screen, rolled those search index view changes forward to point to search stax. Went to the autocomplete tab and no change. Same error.

I rolled back once more, but this time, I deleted the "search autocomplete" from that operations dropdown (as shown in the prod screenshot). Back to migrate screen, rolled search view change forward and bam! I was able to choose "Acquia Solr Search Autocomplete" and successfully hit save. Progress!

I am now running into a separate issue when typing in the search autocomplete. This error presents itself in dblog

Drupal\search_api_solr\SearchApiSolrException: Solr endpoint https://searchcloud-2-us-west-2.searchstax.com:443/ access denied (code: 403, body: {"message":"Invalid key=value pair (missing equal-sign) in Authorization header (hashed with SHA-256 and encoded with Base64): 'XFusFZOOT7l9b/W9HtsR4CsPWFluNJ8FirhZh3OCxdI='."}, message: Solr HTTP error: OK (403) {"message":"Invalid key=value pair (missing equal-sign) in Authorization header (hashed with SHA-256 and encoded with Base64): 'XFusFZOOT7l9b/W9HtsR4CsPWFluNJ8FirhZh3OCxdI='."}). in Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase->handleHttpException() (line 1152 of /var/www/html/docroot/modules/contrib/search_api_solr/src/SolrConnector/SolrConnectorPluginBase.php).

drunken monkey’s picture

Assigned: Unassigned » drunken monkey

Thanks for reporting this problem!
I’ll try to reproduce locally and see what the issue is or how to best fix it.

drunken monkey’s picture

Version: 1.8.1 » 1.x-dev
Assigned: drunken monkey » Unassigned
Status: Active » Needs review

I created a merge request for adapting the associated autocomplete search when switching a search view to a new index. Seems like this isn’t your problem anymore, but should save some headache for other users. Needing to delete the autocomplete configuration before being migrating is a) hard to figure out and b) unnecessarily cumbersome. Seems like it would be pretty simple for us to take care of that. (Unfortunately, I think there will be other modules affected, too, with similar problems, and I don’t think there is a good solution except fixing them one by one.)

Your current problem seems like something else entirely, not actually related to the migration module.
For testing purposes, can you try editing your Drupal search server and using a read-only token for the “Read & write token key” setting? You can’t use that permanently, since indexing won’t work, but does it fix the autocomplete functionality? (It seems like the /emsuggest endpoint that SearchStax provides actually only works with read-only tokens, so that would be something we’d need to fix, too.)

rondog469’s picture

@drunkenmonkey thanks for getting on top of this. I was able to get past the second issue too (with the help of the searchstax team).

I ended up having some misconfigurations within the searchstax platform causing it not to work so you are correct, that is indeed not related to the migrate module. At this point I am mostly good to go, just need to configure some ranking stuff on seachstax as it seems my custom module preQuery EventSubscriber no longer has an effect while using search stax. I believe its because I have that checkbox selected, "route all searches through search studio" or whatever its called

  • drunken monkey committed 46bf0db1 on 1.x
    fix: #3554080 Fixed problem with autocomplete searches after migrating...
drunken monkey’s picture

Merged the MR, will be tested in the dev version.

drunken monkey’s picture

Status: Needs review » Fixed

Released as part of version 1.12.0.

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.