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

eZ Find not updating Solr index correctly for object relations

    Details

      Description

      The main problem is the following which is solved partially by EZP-22859. When you have two objects, let's call them Parent and Child.
      The Parent object has an objectrelationlist attribute. We add Child objects to that relation list.

      We then index these objects in Solr and if we search for Parent filtered by the object relation list containing Child objects it works correctly until the linked Child object is changed.

      The search does a text search for the "title" attribute of the Child object which we just changed and hence it will not match anymore. The problem here is that the objectrelationlist datatype is still referencing the old version of the linked object and the indexing process is getting the old metadata.

      This was actually pointed out on ticket EZP-22859 as one of the last comments (https://jira.ez.no/browse/EZP-22859?focusedCommentId=101881&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-101881).

      A possible solution was to do the following:
      To patch the kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php file at line 1568 with the suggestion from Bruno Fassino's comment. (See attached patch file)

      We also created a new workflow event to run for the above mentioned "Sector" object to get all reverse related objects and reindex them through the ezpending_actions database table and the indexcontent cronjob. Otherwise a full reindex run through eZ Find's updatesearchindexsolr.php script is required to index the changes correctly.


      *Steps to reproduce:*

      1. Create a "Parent" class with the following settings:
      Name: Parent
      Class identifier: parent
      Object name pattern: <title>
      Attributes:
      a. Name: Title
      Identifier: title
      Type: Text line
      b. Name: Children
      Identifier: children
      Type: Object Relations

      2. Create a Child class with the following settings:
      Name: Child
      Class identifier: child
      Object name pattern: <title>
      Attributes:
      a. Name: Title
      Identifier: title
      Type: Text line

      3. Create an object of Child. Set title to "Test child"
      4. Create an object of Parent and add Child in the object relation list
      5. Index the site in Solr
      6. On the Solr admin interface do the following query

      http://[url to solr admin]select?q=*%3A*&fq=attr_+children_t%3A%3D"Test+child"&fq=meta_class_identifier_ms%3A%3D"parent"&fl=attr_title_t&wt=json&indent=true&qt=ezpublish
      

      This should return one result, the Parent object created on step 4.

      7. Change the title of Child to "Something something"
      8. Reindex the site
      9. Execute the following in the Solr admin

      select?q=*%3A*&fq=attr_+children_t%3A%3D"Something+something"&fq=meta_class_identifier_ms%3A%3D"parent"&fl=attr_title_t&wt=json&indent=true&qt=ezpublish
      

      No results will be returned

      10. Apply attached patch to legacy kernel
      11. Reindex site
      12. Execute query from step 9.
      There should be 1 result

        Issue Links

          Activity

          Ricardo Correia (Inactive) created issue -
          Ricardo Correia (Inactive) made changes -
          Field Original Value New Value
          Description The main problem is the following which is solved partially by EZP-22859. When you have two objects, let's call them Parent and Child.
          The Parent object has an {{objectrelationlist}} attribute. We add Child objects to that relation list.

          We then index these objects in Solr and if we search for Parent filtered by the object relation list containing Child objects it works correctly until the linked Child object is changed.

          The search does a text search for the "title" attribute of the Child object which we just changed and hence it will not match anymore. The problem here is that the {{objectrelationlist}} datatype is still referencing the old version of the linked object and the indexing process is getting the old metadata.

          This was actually pointed out on ticket EZP-22859 as one of the last comments (https://jira.ez.no/browse/EZP-22859?focusedCommentId=101881&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-101881).

          A possible solution was to do the following:
          To patch the {{kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php}} file at line 1568 with the suggestion from [~fassino@gmail.com]'s comment. (See attached patch file)

          We also created a new workflow event to run for the above mentioned "Sector" object to get all reverse related objects and reindex them through the {{ezpending_actions}} database table and the {{indexcontent}} cronjob. Otherwise a full reindex run through eZ Find's {{updatesearchindexsolr.php}} script is required to index the changes correctly.

          ----

          **Steps to reproduce:**

          1. Create a "Parent" class with the following settings:
              Name: Parent
              Class identifier: parent
              Object name pattern: <title>
              Attributes:
                   a. Name: Title
                       Identifier: title
                       Type: Text line
                   b. Name: Children
                       Identifier: children
                       Type: Object Relations

          2. Create a Child class with the following settings:
              Name: Child
              Class identifier: child
              Object name pattern: <title>
              Attributes:
              a. Name: Title
                  Identifier: title
                  Type: Text line

          3. Create an object of Child. Set title to "Test child"
          4. Create an object of Parent and add Child in the object relation list
          5. Index the site in Solr
          6. On the Solr admin interface do the following query
              http://[url to solr admin]select?q=*%3A*&fq=attr_+children_t%3A%3D"Test+child"&fq=meta_class_identifier_ms%3A%3D"parent"&fl=attr_title_t&wt=json&indent=true&qt=ezpublish

              This should return one result, the Parent object created on step 4.

          7. Change the title of Child to "Something something"
          8. Reindex the site
          9. Execute the following in the Solr admin
          select?q=*%3A*&fq=attr_+children_t%3A%3D"Something+something"&fq=meta_class_identifier_ms%3A%3D"parent"&fl=attr_title_t&wt=json&indent=true&qt=ezpublish

          No results will be returned

          10. Apply attached patch to legacy kernel
          11. Reindex site
          12. Execute query from step 9.
          There should be 1 result
          The main problem is the following which is solved partially by EZP-22859. When you have two objects, let's call them Parent and Child.
          The Parent object has an {{objectrelationlist}} attribute. We add Child objects to that relation list.

          We then index these objects in Solr and if we search for Parent filtered by the object relation list containing Child objects it works correctly until the linked Child object is changed.

          The search does a text search for the "title" attribute of the Child object which we just changed and hence it will not match anymore. The problem here is that the {{objectrelationlist}} datatype is still referencing the old version of the linked object and the indexing process is getting the old metadata.

          This was actually pointed out on ticket EZP-22859 as one of the last comments (https://jira.ez.no/browse/EZP-22859?focusedCommentId=101881&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-101881).

          A possible solution was to do the following:
          To patch the {{kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php}} file at line 1568 with the suggestion from [~fassino]'s comment. (See attached patch file)

          We also created a new workflow event to run for the above mentioned "Sector" object to get all reverse related objects and reindex them through the {{ezpending_actions}} database table and the {{indexcontent}} cronjob. Otherwise a full reindex run through eZ Find's {{updatesearchindexsolr.php}} script is required to index the changes correctly.

          ----

          **Steps to reproduce:**

          1. Create a "Parent" class with the following settings:
              Name: Parent
              Class identifier: parent
              Object name pattern: <title>
              Attributes:
                   a. Name: Title
                       Identifier: title
                       Type: Text line
                   b. Name: Children
                       Identifier: children
                       Type: Object Relations

          2. Create a Child class with the following settings:
              Name: Child
              Class identifier: child
              Object name pattern: <title>
              Attributes:
              a. Name: Title
                  Identifier: title
                  Type: Text line

          3. Create an object of Child. Set title to "Test child"
          4. Create an object of Parent and add Child in the object relation list
          5. Index the site in Solr
          6. On the Solr admin interface do the following query
              http://[url to solr admin]select?q=*%3A*&fq=attr_+children_t%3A%3D"Test+child"&fq=meta_class_identifier_ms%3A%3D"parent"&fl=attr_title_t&wt=json&indent=true&qt=ezpublish

              This should return one result, the Parent object created on step 4.

          7. Change the title of Child to "Something something"
          8. Reindex the site
          9. Execute the following in the Solr admin
          select?q=*%3A*&fq=attr_+children_t%3A%3D"Something+something"&fq=meta_class_identifier_ms%3A%3D"parent"&fl=attr_title_t&wt=json&indent=true&qt=ezpublish

          No results will be returned

          10. Apply attached patch to legacy kernel
          11. Reindex site
          12. Execute query from step 9.
          There should be 1 result
          Ricardo Correia (Inactive) made changes -
          Attachment objectrelationlisttype.patch [ 19346 ]
          Ricardo Correia (Inactive) made changes -
          Description The main problem is the following which is solved partially by EZP-22859. When you have two objects, let's call them Parent and Child.
          The Parent object has an {{objectrelationlist}} attribute. We add Child objects to that relation list.

          We then index these objects in Solr and if we search for Parent filtered by the object relation list containing Child objects it works correctly until the linked Child object is changed.

          The search does a text search for the "title" attribute of the Child object which we just changed and hence it will not match anymore. The problem here is that the {{objectrelationlist}} datatype is still referencing the old version of the linked object and the indexing process is getting the old metadata.

          This was actually pointed out on ticket EZP-22859 as one of the last comments (https://jira.ez.no/browse/EZP-22859?focusedCommentId=101881&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-101881).

          A possible solution was to do the following:
          To patch the {{kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php}} file at line 1568 with the suggestion from [~fassino]'s comment. (See attached patch file)

          We also created a new workflow event to run for the above mentioned "Sector" object to get all reverse related objects and reindex them through the {{ezpending_actions}} database table and the {{indexcontent}} cronjob. Otherwise a full reindex run through eZ Find's {{updatesearchindexsolr.php}} script is required to index the changes correctly.

          ----

          **Steps to reproduce:**

          1. Create a "Parent" class with the following settings:
              Name: Parent
              Class identifier: parent
              Object name pattern: <title>
              Attributes:
                   a. Name: Title
                       Identifier: title
                       Type: Text line
                   b. Name: Children
                       Identifier: children
                       Type: Object Relations

          2. Create a Child class with the following settings:
              Name: Child
              Class identifier: child
              Object name pattern: <title>
              Attributes:
              a. Name: Title
                  Identifier: title
                  Type: Text line

          3. Create an object of Child. Set title to "Test child"
          4. Create an object of Parent and add Child in the object relation list
          5. Index the site in Solr
          6. On the Solr admin interface do the following query
              http://[url to solr admin]select?q=*%3A*&fq=attr_+children_t%3A%3D"Test+child"&fq=meta_class_identifier_ms%3A%3D"parent"&fl=attr_title_t&wt=json&indent=true&qt=ezpublish

              This should return one result, the Parent object created on step 4.

          7. Change the title of Child to "Something something"
          8. Reindex the site
          9. Execute the following in the Solr admin
          select?q=*%3A*&fq=attr_+children_t%3A%3D"Something+something"&fq=meta_class_identifier_ms%3A%3D"parent"&fl=attr_title_t&wt=json&indent=true&qt=ezpublish

          No results will be returned

          10. Apply attached patch to legacy kernel
          11. Reindex site
          12. Execute query from step 9.
          There should be 1 result
          The main problem is the following which is solved partially by EZP-22859. When you have two objects, let's call them Parent and Child.
          The Parent object has an {{objectrelationlist}} attribute. We add Child objects to that relation list.

          We then index these objects in Solr and if we search for Parent filtered by the object relation list containing Child objects it works correctly until the linked Child object is changed.

          The search does a text search for the "title" attribute of the Child object which we just changed and hence it will not match anymore. The problem here is that the {{objectrelationlist}} datatype is still referencing the old version of the linked object and the indexing process is getting the old metadata.

          This was actually pointed out on ticket EZP-22859 as one of the last comments (https://jira.ez.no/browse/EZP-22859?focusedCommentId=101881&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-101881).

          A possible solution was to do the following:
          To patch the {{kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php}} file at line 1568 with the suggestion from [~fassino]'s comment. (See attached patch file)

          We also created a new workflow event to run for the above mentioned "Sector" object to get all reverse related objects and reindex them through the {{ezpending_actions}} database table and the {{indexcontent}} cronjob. Otherwise a full reindex run through eZ Find's {{updatesearchindexsolr.php}} script is required to index the changes correctly.

          ----

          **Steps to reproduce:**

          1. Create a "Parent" class with the following settings:
              Name: Parent
              Class identifier: parent
              Object name pattern: <title>
              Attributes:
                   a. Name: Title
                       Identifier: title
                       Type: Text line
                   b. Name: Children
                       Identifier: children
                       Type: Object Relations

          2. Create a Child class with the following settings:
              Name: Child
              Class identifier: child
              Object name pattern: <title>
              Attributes:
              a. Name: Title
                  Identifier: title
                  Type: Text line

          3. Create an object of Child. Set title to "Test child"
          4. Create an object of Parent and add Child in the object relation list
          5. Index the site in Solr
          6. On the Solr admin interface do the following query
          {noformat}
          http://[url to solr admin]select?q=*%3A*&fq=attr_+children_t%3A%3D"Test+child"&fq=meta_class_identifier_ms%3A%3D"parent"&fl=attr_title_t&wt=json&indent=true&qt=ezpublish
          {noformat}
              This should return one result, the Parent object created on step 4.

          7. Change the title of Child to "Something something"
          8. Reindex the site
          9. Execute the following in the Solr admin
          {noformat}
          select?q=*%3A*&fq=attr_+children_t%3A%3D"Something+something"&fq=meta_class_identifier_ms%3A%3D"parent"&fl=attr_title_t&wt=json&indent=true&qt=ezpublish
          {noformat}

          No results will be returned

          10. Apply attached patch to legacy kernel
          11. Reindex site
          12. Execute query from step 9.
          There should be 1 result
          Ricardo Correia (Inactive) made changes -
          Status Open [ 1 ] Confirmed [ 10037 ]
          Ricardo Correia (Inactive) made changes -
          Link This issue relates to EZP-22859 [ EZP-22859 ]
          Paulo Lopes (Inactive) made changes -
          Status Confirmed [ 10037 ] InputQ [ 10001 ]
          André Rømcke made changes -
          Rank Ranked higher
          André Rømcke made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Assignee André Rømcke [ andre.romcke@ez.no ]
          Show
          André Rømcke added a comment - PR: https://github.com/ezsystems/ezpublish-legacy/pull/1146
          André Rømcke made changes -
          Status Development [ 3 ] Development Review [ 10006 ]
          Fix Version/s 5.3.5 [ 13889 ]
          Fix Version/s 5.4.2 [ 13979 ]
          Show
          André Rømcke added a comment - Merged in https://github.com/ezsystems/ezpublish-legacy/commit/96cb6e10ac1522a254ad9da47945026490a220d6
          André Rømcke made changes -
          Status Development Review [ 10006 ] Development Review done [ 10028 ]
          André Rømcke made changes -
          Status Development Review done [ 10028 ] Documentation Review done [ 10011 ]
          Rui Silva (Inactive) made changes -
          Status Documentation Review done [ 10011 ] QA [ 10008 ]
          Assignee André Rømcke [ andre.romcke@ez.no ] Rui Silva [ rui.silva@ez.no ]
          Hide
          Rui Silva (Inactive) added a comment -

          Tested and approved by QA, for 5.3 and 5.4.

          Show
          Rui Silva (Inactive) added a comment - Tested and approved by QA, for 5.3 and 5.4.
          Rui Silva (Inactive) made changes -
          Assignee Rui Silva [ rui.silva@ez.no ]
          Status QA [ 10008 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          André Rømcke made changes -
          Workflow eZ Engineering Scrumban Workflow [ 66362 ] EZ* Development Workflow [ 85754 ]
          Alex Schuster made changes -
          Workflow EZ* Development Workflow [ 85754 ] EZEE Development Workflow [ 124651 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Confirmed Confirmed
          8m 3s 1 ricardo.correia@ez.no 03/Mar/15 4:07 PM
          Confirmed Confirmed InputQ InputQ
          1m 52s 1 Paulo Lopes (Inactive) 03/Mar/15 4:09 PM
          InputQ InputQ Development Development
          52m 52s 1 André Rømcke 03/Mar/15 5:02 PM
          Development Development Development Review Development Review
          18m 39s 1 André Rømcke 03/Mar/15 5:21 PM
          Development Review Development Review Development Review done Development Review done
          1d 22h 34m 1 André Rømcke 05/Mar/15 3:55 PM
          Development Review done Development Review done Documentation Review done Documentation Review done
          1m 11s 1 André Rømcke 05/Mar/15 3:56 PM
          Documentation Review done Documentation Review done QA QA
          19m 30s 1 rui.silva@ez.no 05/Mar/15 4:16 PM
          QA QA Closed Closed
          19h 8m 1 rui.silva@ez.no 06/Mar/15 11:24 AM

            People

            • Assignee:
              Unassigned
              Reporter:
              Ricardo Correia (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: