You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both REST "v1/search" and GraphQL "products" use Elasticsuite and correctly :
take into account the store context (either by URL or HTTP header)
apply search terms merchandising blacklisting of products
apply search optimizers
But the search_query.position / ASC sort order is never applied to the generated Elasticsearch query : search terms merchandiser positions are not applied.
Preconditions
Magento Version : 2.3.2
ElasticSuite Version : 2.8.2, 2.8.3, 2.8-x
Environment : Developer
Third party modules : N/A
Steps to reproduce
On a Luma instance, search in frontend for the term "gym"
Then go back to the admin in "Marketing / Search terms" and edit the "gym" search term
Go the merchandiser screen, clear all positions, save and continue
Pick 1 or 2 distinctive products located after the 10th position and pin them at the beginning
Blacklist one of the products at the beginning of the results
Save and continue, and check in frontend that the positions and the blacklisting are correctly applied
Use a GraphQL client (for instance GraphiQL) and perform a search with the "products" query on the http://domain.tld/graphql endpoint while forcing a big page size
{
products(search: "gym", pageSize: 100, currentPage: 1) {
total_count
sort_fields {
default
options {
label
value
}
}
items {
id
sku
name
}
}
}
PS : Using a big page size is important. You need to specify a page size bigger than the amount of results because of an bug in the native Magento\CatalogGraphQL module.
Searching for "gym" in a Luma should match less than 30 products, so searching with a pageSize of 100 is a safe approach.
Expected result
Both with REST v1/search and GraphQL, the relative order of search results should be the same as in the frontend
Actual result
The blacklisted products are correctly missing from the results, but the specific pinned positions are ignored
In both cases, inspecting the queries in the debug log shows that the "bool/must_not/search_query.is_blacklisted" query filter is applied, but not the "search_query.position/asc" sort order.
The text was updated successfully, but these errors were encountered:
rbayet
changed the title
Search terms position sorting applied on REST "v1/search" and GraphQL "products" API calls
Search terms position sorting NOT applied on REST "v1/search" and GraphQL "products" API calls
Jan 14, 2020
Both REST "v1/search" and GraphQL "products" use Elasticsuite and correctly :
But the search_query.position / ASC sort order is never applied to the generated Elasticsearch query : search terms merchandiser positions are not applied.
Preconditions
Magento Version : 2.3.2
ElasticSuite Version : 2.8.2, 2.8.3, 2.8-x
Environment : Developer
Third party modules : N/A
Steps to reproduce
PS : Using a big page size is important. You need to specify a page size bigger than the amount of results because of an bug in the native Magento\CatalogGraphQL module.
Searching for "gym" in a Luma should match less than 30 products, so searching with a pageSize of 100 is a safe approach.
Expected result
Actual result
The text was updated successfully, but these errors were encountered: