Details
-
Improvement
-
Resolution: Unresolved
-
Medium
-
5.3.4
-
None
Description
The default sort method used by ezjscore Ajax search is published desc.
When used with ezfind, this leads to getting as first results not significant results (will be the latest documents that contain any of query term in its copy field).
This ajax method is notably used in the edit view of the object relation list data type to search for objects to put in relation, which makes this functionality unusable as soon as the entered query contains some common terms.
The SortBy parameter (used by ezfind search) should be set to ('score', 'desc').
As a possible enhancement, it would be nice to get the ability to customize the Sort method used through a POST parameter for this method too.
Steps to reproduce:
- Create at least a content with common terms, such as "ez", "article" and "test"
- Create additional content objects each containing only one of those words.
- make sure the objects are indexed, perform a search by "ez article test" on the frontend and verify the results (they should appear ordered by score).
- Edit an object containing a relation list
- On the relation list, search for this query
Result:
- The newer articles will be displayed first, even though they are less relevant.
Additional notes:
In ezjscserverfunctionsjs.php::search , two different sort parameters are used: one for legacy search engine, another for eZ Find.
// Prepare search parameters $params = array( 'SearchOffset' => $searchOffset, 'SearchLimit' => $searchLimit, 'SortArray' => array( 'published', 0 ), // Legacy search engine uses SortArray 'SortBy' => array( 'published' => 'desc' ) // eZ Find search method implementation uses SortBy );