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

Content search returns content several times when it has several locations

    Details

    • Type: Bug Bug
    • Status: InputQ
    • Priority: High High
    • Resolution: Unresolved
    • Affects Version/s: 1.10.0-beta3, 1.7.8, 1.13.4, 2.3.2, 2.4.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      Currently only reproduced on Legacy Search engine, afaik not a problem with solr but someone should check.

      This was reproduced on a whim using Platform UI. Because REST API lookups adds latency, Platform UI uses Search for a lot of things to avoid that, including loading content by id's for sub items view. While that is something to solve at some point to be able to cache these lookups, thats beyond this issue.

      Both symptoms in UI, as well as the request and response payload attached as images.

      What happens is:

      • ContentQuery search using ContentIdCriterion is used, limit is set to same number previous location search result for sub items gave as it is below the current default max of 10 items
      • 5 Items are correctly returned as expected in this case
      • However the last item comes up twice because it has two locations (the other location is in media tree)

      Sp some join going wrong here in content search, or the criterion is using wrong table for content search here making it behave as a location criteria*.

      • As in we have had such issues in the past to, but they only affected location criteria, and solution to that was to deprecate them and introduce location search as the solution to it for correct modeling of the problem.

        Issue Links

          Activity

          Hide
          Andrzej Longosz added a comment -

          Note: interesting thing... I've just reproduced this issue when trying to solve issue found by the QA when testing EZP-28663. However for me it happens after Location Swap. Content just having multiple Locations is not enough for it to occur.

          Show
          Andrzej Longosz added a comment - Note: interesting thing... I've just reproduced this issue when trying to solve issue found by the QA when testing EZP-28663 . However for me it happens after Location Swap. Content just having multiple Locations is not enough for it to occur.
          Hide
          Andrzej Longosz added a comment -

          As mentioned earlier - seems location swap was missing from steps to reproduce. I've reviewed Legacy Search query building for this Criterion and such case should occur only on a corrupted database - when Content after some operation gets multiple main locations. So far we've identified only swap as the one that might cause problems - the description provided by Marek Nocoń in the ezsystems/ezpublish-kernel#2531 PR matches exactly that case (issue described there occurs due that erroneous REST response with Content item returned twice).

          That said, there might be another source of database corruption, but it needs to be handled case-by-case as the source of error does not exist in LSE.

          Right now I'd recommend the QA to test this issue when testing EZP-28663.

          Show
          Andrzej Longosz added a comment - As mentioned earlier - seems location swap was missing from steps to reproduce. I've reviewed Legacy Search query building for this Criterion and such case should occur only on a corrupted database - when Content after some operation gets multiple main locations. So far we've identified only swap as the one that might cause problems - the description provided by Marek Nocoń in the ezsystems/ezpublish-kernel#2531 PR matches exactly that case (issue described there occurs due that erroneous REST response with Content item returned twice). That said, there might be another source of database corruption, but it needs to be handled case-by-case as the source of error does not exist in LSE. Right now I'd recommend the QA to test this issue when testing EZP-28663 .
          Hide
          Marek Nocoń added a comment -

          Had this issue in mind when testing https://jira.ez.no/browse/EZP-28663 - I was not able to reproduce this issue with the fix for Location swapping.
          Keeping the issue open, as there might also be another cause for it?

          Show
          Marek Nocoń added a comment - Had this issue in mind when testing https://jira.ez.no/browse/EZP-28663 - I was not able to reproduce this issue with the fix for Location swapping. Keeping the issue open, as there might also be another cause for it?
          Hide
          Andrzej Longosz added a comment -

          The point was to reproduce the issue w/o patch for EZP-28663 as the bug discovered by you there is the same as this issue describes and the EZP-28663 fixes it. There might be another sources of that bug, but they need to be taken separately based on source, because the bug is not related to LSE but corrupted database.

          Show
          Andrzej Longosz added a comment - The point was to reproduce the issue w/o patch for EZP-28663 as the bug discovered by you there is the same as this issue describes and the EZP-28663 fixes it. There might be another sources of that bug, but they need to be taken separately based on source, because the bug is not related to LSE but corrupted database.
          Hide
          Marek Nocoń added a comment - - edited

          I've tried it on 1.7 and I cannot reproduce it:

          • without EZP-28663 it's not possible to swap non-main locations (database is not corrupted)
          • with 126ce15bc55d7f5dba9b7753614d83b5c5fe40f1 (commit that was tested when comment https://github.com/ezsystems/ezpublish-kernel/pull/2531#pullrequestreview-194928786 was written) PlatformUI does not return multiple results for my Folder with multiple main node values for the same content object - instead it breaks and does not display any results at all (and spinner doesn't disappear).
          Show
          Marek Nocoń added a comment - - edited I've tried it on 1.7 and I cannot reproduce it: without EZP-28663 it's not possible to swap non-main locations (database is not corrupted) with 126ce15bc55d7f5dba9b7753614d83b5c5fe40f1 (commit that was tested when comment https://github.com/ezsystems/ezpublish-kernel/pull/2531#pullrequestreview-194928786 was written) PlatformUI does not return multiple results for my Folder with multiple main node values for the same content object - instead it breaks and does not display any results at all (and spinner doesn't disappear).
          Hide
          Andrzej Longosz added a comment -

          Ok, then the source of that bug must be different. Thanks for testing. I'll revise it again.

          Show
          Andrzej Longosz added a comment - Ok, then the source of that bug must be different. Thanks for testing. I'll revise it again.

            People

            • Assignee:
              Unassigned
              Reporter:
              André Rømcke
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours
                5h