Details

      Description

      It seems that when using sort_by parameter in ezfind fetch the sorting isn't right when the string contains some characters, for example spaces and/or dashes .

      Also if the name contains ä/ö etc. characters they get sorted incorrectly (ä will get sorted first).

      Steps to reproduce

      In default ezwebin - installation, create a few Product - class objects under for example Products/Software - node.
      Use for example the following names for the products (or something similar)
      aaaaaa
      aa-bb
      aa-cc
      ba-ab
      bbbbb
      ccccccccc
      ffffffffffffffff
      ff gg
      gaga
      gg ff
      gggggg
      OS Type I
      Test-Product

      Now if you use the following ezfind fetch:

      {def $srch=fetch('ezfind', 'search', hash(
                 'query', '',
                 'limit', 20,
                 'subtree_array', array(70),
                 'class_id', 'product',
                 'sort_by', hash('product/name', 'asc')
                 ))}
       
      {foreach $srch.SearchResult as $s}
         {$s.name}<br />
      {/foreach}
      

      70 is the node id for products/software in default ezwebin install.
      What you end up with is a list of products which are certainly not ordered correctly.. What I get is this:
      aaaaaa
      ba-ab
      aa-bb
      bbbbb
      aa-cc
      ccccccccc
      ffffffffffffffff
      gaga
      ff gg
      gg ff
      gggggg
      Test-Product
      OS Type I

      What you will get may vary.. It seems there's absolutely no logic to the sorting. Sometimes names with dashes and or whitespaces get ordered correctly and sometimes the get ordered according to the string after the dash or whitespace..

        Activity

        Hide
        ezrobot added a comment -

        This issue has been automatically closed due to the lack of activity over a long period of time. It is very likely that it is obsolete, but if you think it is still valid, do not hesitate to reopen it and mention why.

        Show
        ezrobot added a comment - This issue has been automatically closed due to the lack of activity over a long period of time. It is very likely that it is obsolete, but if you think it is still valid, do not hesitate to reopen it and mention why.
        Hide
        Vincent Tabary added a comment -

        In the ezfind extension, there is a lack in the setting file "settings/ezfind.ini" for the type ezstring.

        Here is the modified category of my file :

        [SolrFieldMapSettings]

        1. List of custom datatype mapping. eZ Publish datatype string is used
        2. as key, and the value if the name of the class to use.
          #
        3. Example:
        4. CustomMap[eztext]=ezfSolrDocumentFieldText
          CustomMap[ezobjectrelation]=ezfSolrDocumentFieldObjectRelation
          CustomMap[ezobjectrelationlist]=ezfSolrDocumentFieldObjectRelation
          CustomMap[ezxmltext]=ezfSolrDocumentFieldXML
          CustomMap[ezmatrix]=ezfSolrDocumentFieldXML
        1. Datatype to field type map.
          #
        2. Example:
          DatatypeMap[ezstring]=string
          DatatypeMap[eztext]=text
          DatatypeMap[ezboolean]=boolean
          DatatypeMap[ezdate]=date
          DatatypeMap[ezdatetime]=date
          DatatypeMap[ezfloat]=sfloat
          DatatypeMap[ezinteger]=sint
          DatatypeMap[ezprice]=sfloat
          DatatypeMap[eztime]=date
        3. Default field type
          Default=text

        The only difference with the initial file is the line :

        DatatypeMap[ezstring]=string

        For me, this was the solution. Hope this will help

        Show
        Vincent Tabary added a comment - In the ezfind extension, there is a lack in the setting file "settings/ezfind.ini" for the type ezstring. Here is the modified category of my file : [SolrFieldMapSettings] List of custom datatype mapping. eZ Publish datatype string is used as key, and the value if the name of the class to use. # Example: CustomMap [eztext] =ezfSolrDocumentFieldText CustomMap [ezobjectrelation] =ezfSolrDocumentFieldObjectRelation CustomMap [ezobjectrelationlist] =ezfSolrDocumentFieldObjectRelation CustomMap [ezxmltext] =ezfSolrDocumentFieldXML CustomMap [ezmatrix] =ezfSolrDocumentFieldXML Datatype to field type map. # Example: DatatypeMap [ezstring] =string DatatypeMap [eztext] =text DatatypeMap [ezboolean] =boolean DatatypeMap [ezdate] =date DatatypeMap [ezdatetime] =date DatatypeMap [ezfloat] =sfloat DatatypeMap [ezinteger] =sint DatatypeMap [ezprice] =sfloat DatatypeMap [eztime] =date Default field type Default=text The only difference with the initial file is the line : DatatypeMap [ezstring] =string For me, this was the solution. Hope this will help
        Hide
        Alexandre Nion added a comment -

        Hi,
        This might be because of solr tokenization.
        You should check your datatype and index, it seems to be a text line which will be mapped to a "text" solr type. This one will then be marked as tokenized (to allow search on partial strings) and the side effect is that in some cases results of sorts might not comply to what we would expect. We also observed that kind of results.
        Not sure a better solution could be found in eZ find, by now as a workaround we have added for that kind of sorts a sort-dedicated attribute whose solr type is "string" (virtually added, cd #15222 ), might be an option.

        Show
        Alexandre Nion added a comment - Hi, This might be because of solr tokenization. You should check your datatype and index, it seems to be a text line which will be mapped to a "text" solr type. This one will then be marked as tokenized (to allow search on partial strings) and the side effect is that in some cases results of sorts might not comply to what we would expect. We also observed that kind of results. Not sure a better solution could be found in eZ find, by now as a workaround we have added for that kind of sorts a sort-dedicated attribute whose solr type is "string" (virtually added, cd #15222 ), might be an option.
        Hide
        Jarosław-- Heba added a comment -

        ehh.. wrong tab

        Show
        Jarosław-- Heba added a comment - ehh.. wrong tab

          People

          • Assignee:
            unknown
            Reporter:
            Tuomo Syvänperä
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: