Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-24236

ezjscore search sort order when using eZFind : sort by score, not published

    XMLWordPrintable

    Details

      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:
      1. Create at least a content with common terms, such as "ez", "article" and "test"
      2. Create additional content objects each containing only one of those words.
      3. 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).
      4. Edit an object containing a relation list
      5. On the relation list, search for this query
      Result:
      1. 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
      );
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            joao.inacio-obsolete@ez.no Joao Inacio (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: