Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexing issue when installed in Multi Store/website when not all stores use doofinder #348

Open
natedawg92 opened this issue Oct 21, 2024 · 5 comments · May be fixed by #359
Open

Indexing issue when installed in Multi Store/website when not all stores use doofinder #348

natedawg92 opened this issue Oct 21, 2024 · 5 comments · May be fixed by #359
Assignees
Labels
bug Tech debt | Errors in the code pluginRangers product

Comments

@natedawg92
Copy link

natedawg92 commented Oct 21, 2024

When the module is installed the Cron and manual indexing processor will attempt to loop through all stores (both active and not) and attempt to process items for those stores. This process requires gathering the Hash ID for each store.

In our example we have a main store that is using Doofinder and is configured and has been running without issue for some time. We have since added 2 new websites and store views that we don't want to use Doofinder on so haven't configured these (i.e. haven't added a Hash ID). Because of this the indexer for the main store has now stopped working.

Ideally we should be able to enable/disable Doofinder at minimum at a website level and this should be checked when going through the processor and when registering item change events.

main.CRITICAL: TypeError: Doofinder\Feed\Helper\SearchEngine::getSearchEngine(): Argument #1 ($hashId) must be of type string, null given, called in /domains/example.co.uk/http/vendor/doofinder/doofinder-magento2/Helper/SearchEngine.php on line 183 and defined in /domains/example.co.uk/http/vendor/doofinder/doofinder-magento2/Helper/SearchEngine.php:164
@natedawg92
Copy link
Author

natedawg92 commented Oct 21, 2024

note we're on version 0.14.4 so those line numbers might not match up exactly to the latest version however i have checked the latest master branch and this functionality isn't present

@sofia-doofinder
Copy link
Member

Thank you @natedawg92 for you feedback.

@IgnacioPursalsZ

@sofia-doofinder sofia-doofinder added enhancement pluginRangers bug Tech debt | Errors in the code and removed enhancement labels Oct 21, 2024
@IgnacioPursalsZ
Copy link

Hi @natedawg92, I apologize that I didn't understood what u were trying to say. Do you want to be able to turn off the indexing for some stores manually, or do you want them not to be indexed in the ones that are deactivated?

@natedawg92
Copy link
Author

Hi @IgnacioPursalsZ A bit of both really, When no Hash ID is configured against a store view the indexing will fall over, failing to index the store(s) that are configured. Ideally there should be better checks in processing so that stores that aren't configured aren't even attempted to be indexed.

Currently the config path `doofinder_config_config/doofinder_layer/doofinder_layer_enabled' is only shown in the default scope so we can't disable at website or store views where Doofinder wouldn't be used.

due to this change events are captured for all stores rather than just the store(s) we want to use doofinder on and indexing attempts to reindex for all stores.

from a high level view i think the solution would be that whenever looping through stores such as https://github.com/doofinder/doofinder-magento2/blob/master/Observer/Product/AbstractChangedProductObserver.php#L96 there should be a check for isEnabledAndConfigured which checks the value of doofinder_config_config/doofinder_layer/doofinder_layer_enabled' for the store and confirming that the store has a Hash ID

@brunovesar brunovesar self-assigned this Nov 22, 2024
@brunovesar brunovesar linked a pull request Nov 22, 2024 that will close this issue
@sofia-doofinder
Copy link
Member

@brunovesar el PR que has hecho es para que no se haga un update on save sobre aquellas stores que no tienen un hashid configurado, no? Creo que también se pide que si no tiene hashid que no se muestra la capa en esa store, o lo estoy entendiendo mal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Tech debt | Errors in the code pluginRangers product
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants