Automattic / Automattic/jetpack

Search: Searching for products with WPML installed returns multiple instances of the same product

Open
#16,188 2 comments 0 reactions 0 assignees View on GitHub
[Feature] Search [Focus] i18n Enhancement
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

The site where I encountered the issue has WooCommerce and WPML installed. There are three different versions of the site (English, Russian, and Latvian). The problem is, when Jetpack search is enabled (The old search, not the 'instant search', it's called "Replace WordPress built-in search with an improved search experience" on Calypso) - when you search for a product, it returns multiple products of the same name from all versions (languages) of the site.

However, in certain other languages, none of the products show up on search results.

#### Steps to reproduce the issue

I haven't reproduced this on my test sites. The steps are from the site of the user who reported it.

1. Have WooCommerce and WPML installed with products in multiple languages (with the same name) and a toggle to switch between the languages in the menu.
2. Search for the product using the search button.
3. Switch between different languages to see the search result for the same search term is different.

#### What I expected

I expected the search terms to show the search result for either the same product regardless of which language/version is chosen.

#### What happened instead

In English version, the same product is listed three times:

![Screen Shot 2020-06-18 at 6 07 11 PM](https://user-images.githubusercontent.com/2541844/85018163-8b5fb880-b18e-11ea-8b65-ad0476bb4cc0.png)

In Russian, none of them are displayed:

![Screen Shot 2020-06-18 at 6 07 54 PM](https://user-images.githubusercontent.com/2541844/85018228-a5010000-b18e-11ea-9a18-939bf56f151e.png)

Issue reported in #21973904-hc
Follow-up ticket in #3071272-zd

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with Jetpack search, WooCommerce, and WPML using products translated into English, Russian, and Latvian. Compare results across the language switcher; done means the same product is not duplicated and remains searchable consistently in each language.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.