0

I get some duplicate article for the site. How can i remove the duplicate? There is no distinct setting. Here is the setting of view view setting

1

Depending on your setup there are different reasons why you can get duplicates. A common reason is, that you're using related entities (nodes, taxonomies). Let's say you got a content type car with a taxonomy term that shows the car's color. If you create a relationship between car and color in your view, you can see duplicates if a car has multiple colors.

There are three different options that allow you to reduce duplicates.

In the view's ADVANCED tab you can find USE AGGREGATION and QUERY SETTINGS. Try out which of them works for your use case.

View's Advanced Settings

Inside QUERY SETTINGS you can find the DISTINCT option.

enter image description here

If you enable USE AGGREGATION your fields and filters will receive a new option AGGREGATION SETTINGS where you can define the type of aggregation (ie. Group results, Minimum, Maximum, etc.)

enter image description here

When you add fields to your FILTER CRITERIA there is another setting to prevent duplicate entries when a filter is applies.

enter image description here

But beware, complex views tend to get slow when aggregation is enabled.

  • There is no distinct option in Query Settings, only "Skip item access checks" option. I also don't see any setting for preventing duplicate entries. What is the setting? – Linh Nguyen Jun 26 at 17:57
  • I updated my previous answer, hope that helps to clarify. – electric.larry Jun 28 at 7:41
  • None of them works for me. No AGGREGATION, no reduce duplicates and my query setting only has " Skip item access checks" – Linh Nguyen Jul 4 at 0:04
  • @LinhNguyen what Drupal version is this? – electric.larry Jul 4 at 9:13
  • Drupal version 8.7.3 – Linh Nguyen Jul 8 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.