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: Admin searches in WooCommerce taxonomies return no results #2791

Closed
JakePT opened this issue May 24, 2022 · 0 comments · Fixed by #2817
Closed

BUG: Admin searches in WooCommerce taxonomies return no results #2791

JakePT opened this issue May 24, 2022 · 0 comments · Fixed by #2817
Assignees
Labels
bug Something isn't working module:woocommerce Issues related to the WooCommerce functionality
Milestone

Comments

@JakePT
Copy link
Contributor

JakePT commented May 24, 2022

Describe the bug
When searching within WooCommerce Product Categories or product attributes in the admin with the Terms feature enabled, no results are returned.

With Debug Bar enabled two Elasticsearch queries will be shown. One of them will have no results, but the other one will have the expected results. The queries are exactly the same excerpt two differences. Firstly, the query with no results is sorted with

"sort": [
	{
		"meta.order.long": {
			"order": "asc"
		}
	}
],

And has this additional post_filter:

{
	"bool": {
		"must": [
			{
				"terms": {
					"meta.order.raw": [
						""
					]
				}
			}
		]
	}
}

So the cause has to be something to do with the custom sorting of terms used by WooCommerce.

Steps to Reproduce

  1. Install WooCommerce.
  2. Import WooCommerce sample data.
  3. Go to Products > Categories and search for "Decor". No results are returned.
  4. Go to Products > Attributes > color > Configure terms and search for "Gray". No results are returned.
  5. Disabled the Terms feature and repeat the searches. Results should be returned as expected.

Expected behavior
Searching terms should return matching terms.

@JakePT JakePT added bug Something isn't working module:woocommerce Issues related to the WooCommerce functionality labels May 24, 2022
@felipeelia felipeelia added this to the 4.3.0 milestone May 24, 2022
@felipeelia felipeelia modified the milestones: 4.3.0, 4.2.1 Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module:woocommerce Issues related to the WooCommerce functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants