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

BUG: Search in multisite for 'sites' => 'current' #3225

Closed
1 task done
anders-naslund opened this issue Dec 21, 2022 · 2 comments · Fixed by #3243
Closed
1 task done

BUG: Search in multisite for 'sites' => 'current' #3225

anders-naslund opened this issue Dec 21, 2022 · 2 comments · Fixed by #3243
Assignees
Labels
bug Something isn't working
Milestone

Comments

@anders-naslund
Copy link

Describe the bug

After upgrading to Elasticpress 4.4.0 we are no longer able to search within the 'current' site, all requests seams to be using the Main site URL

Steps to Reproduce

If the search quests is using:

new WP_Query( array(
    's'     => 'search phrase',
    'sites' => 'current',
) );

It doesn't work !

But if it's changed to:

new WP_Query( array(
    's'     => 'search phrase',
    'sites' => get_current_blog_id(),
) );

It starts working correctly again

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress and ElasticPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@anders-naslund anders-naslund added the bug Something isn't working label Dec 21, 2022
@oscarssanchez
Copy link
Contributor

Hi @anders-naslund ,

By what you said, it seems this would be a regression? If so, can you let us know which version was working correctly for you?

@anders-naslund
Copy link
Author

anders-naslund commented Dec 21, 2022

4.3.1 was working fine,
looks like it might have to do with changes in [includes/classes/Indexable/Comment/QueryIntegration.php]

Changed to use 'sites__in' according to the release note but still 'current' is not working so if that's not going to work anymore you might need to update this article.
https://elasticpress.zendesk.com/hc/en-us/articles/360052027951-How-can-I-search-across-multiple-sites-in-a-multi-site-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants