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

ezFind IndexBoost not working in some locales

    XMLWordPrintable

Details

    Description

      When locale ist set to german, a float value of 2.5 is converted into "2,5" which result in an indexing error in SolR.

      #ezfind.ini
      [IndexBoost]
      Class[]
      Class[user]=1.5
      

      This comes from an implicit type conversion float->string which is not right in this case. I will provide a PR with a fix for this.

      Edit:

      Steps to reproduce:

      1. Prepare an environment where the default language is German:

      $ locale
      LANG=de_DE.UTF-8
      LANGUAGE=
      LC_CTYPE="de_DE.UTF-8"
      LC_NUMERIC="de_DE.UTF-8"
      LC_TIME="de_DE.UTF-8"
      LC_COLLATE="de_DE.UTF-8"
      LC_MONETARY="de_DE.UTF-8"
      LC_MESSAGES="de_DE.UTF-8"
      LC_PAPER="de_DE.UTF-8"
      LC_NAME="de_DE.UTF-8"
      LC_ADDRESS="de_DE.UTF-8"
      LC_TELEPHONE="de_DE.UTF-8"
      LC_MEASUREMENT="de_DE.UTF-8"
      LC_IDENTIFICATION="de_DE.UTF-8"
      LC_ALL=
      

      2. Prepare a test eZ Publish 5.3 installation, fully updated to 5.3.7, with the default language set to ger-DE;
      3. Install eZ Find, and start Solr;
      4. Configure ezfind.ini like this:

      [IndexBoost]
      Class[]
      Class[article]=3.2
      

      5. Edit /ezpublish_legacy/extension/ezfind/bin/php/updatesearchindexsolr.php and add a new "setlocale(LC_ALL, 'de_DE.UTF-8');" line:

      ...
      require 'autoload.php';
      
      setlocale(LC_ALL, 'de_DE.UTF-8');
      
      if ( !function_exists( 'readline' ) )
      {
      ...
      

      6. Run Solr indexing by calling updatesearchindexsolr.php:

      $ php ezpublish/console ezpublish:legacy:script extension/ezfind/bin/php/updatesearchindexsolr.php --siteaccess=ezdemo_site_admin --clean-all
      Running script 'extension/ezfind/bin/php/updatesearchindexsolr.php' in eZ Publish legacy context
      eZSearchEngine: Cleaning up search data for all installations
      Starting object re-indexing
      Using fork.
      Using 2 concurent process(es)
      Number of objects to index: 73
      
      Creating a new thread: 5631
      ...................................................................... 95.89%
      ...                                                                    100.00%
       Failed indexing article object with ID 58
       Failed indexing article object with ID 62
       Failed indexing article object with ID 63
       Failed indexing article object with ID 64
      ... 95.89%
      ...                                                                    100.00%
      
      Creating a new thread: 5632
      
      Creating a new thread: 5633 Failed indexing article object with ID 65
       Failed indexing article object with ID 67
       Failed indexing article object with ID 68
       Failed indexing article object with ID 69
       Failed indexing article object with ID 70
       Failed indexing article object with ID 71
       Failed indexing article object with ID 79
       Failed indexing article object with ID 80
       Failed indexing article object with ID 81
      ... 95.89%
      ...                                                                    100.00%
      
      Creating a new thread: 5632
       Failed indexing article object with ID 82
       Failed indexing article object with ID 93
       Failed indexing article object with ID 119
      
      
      
      Creating a new thread: 5634
      
      Number of objects to index: 73
      
      
      Creating a new thread: 5634
      
      Creating a new thread: 5635
      Process finished: 5635
      Process finished: 5631
      Optimizing. Please wait ...
      Indexing took 5,0901699066162 secs ( average: 14,341368036677 objects/sec )
      Finished updating the search index.
      

      All objects that belong to the class(es) specified in ezfind.ini[IndexBoost]Class[] - article, in this case - will fail indexation.

      Attachments

        Activity

          People

            Unassigned Unassigned
            5860e71c-1364-4e9a-9f7c-45017c6b4c16@accounts.ibexa.co Hannes Giesenow
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h