0

Content Type A -Nid A -Field A

Content Type B -Nid B -Reference Nid A

How can I find in a view all As that have no reference in B ?

in sql this is

select A.field
FROM TABLE A
LEFT JOIN TABLE B
ON A.KEY = B.KEY 
WHERE B.key IS NULL

I have tried Views reference filter, but it is very slow and consume a lot of memory (the trick with this modules is not a join but a SELECT... NOT IN (...).

Which is very inefficient, because, i have 16.000 As and 14.000 Bs.

Is there any efficient solutions with views?

Thanks.

1

Well, maybe it is idiotic, but finally I understood the issue with the relationships and the "referenced vs referencing"

So, what I did was:

relationships : "Content referenCING Content from A_REFERENCE_IN_B" Fields A (the fields you want) Filter type = Type A Filter NID (using the relationship) , is null.

Amazing, and super fast.

The important part is REFERENCING not referenced.

Thanks.

  • Thanks for coming back with your solution. I was just about to post this. – Niall Murphy Dec 10 '16 at 2: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.