Multilingual Search shows wrong results number (especially with blank query)

Created on 17 February 2023, over 1 year ago
Updated 30 May 2023, over 1 year ago

Problem/Motivation

In Multilingual Search IndexResource builds query to search engine (in my case Solr). Solr response returns nodes in all languages. Than createCollectionDataFromEntities grabs all data and returns only results in queried language but counter is set from solr response $primary_data->setTotalCount((int) $results->getResultCount());.
E.g. we have node in 10 languages. During blank query Solr returns all data in all languages (10 nodes). In search response there will be only 1 node but counter will be set as 10.

Furthermore because of limits during the query $query->range($pagination->getOffset(), $pagination->getSize()); it gets asked amount of results which and createCollectionDataFromEntities method and can return entities from first 50 Solr results and ignore others which are out of range but in response you can get 3 or 4 entities instead of real amount.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024