All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Search for entries where the related parent entry has status Open

zizther 13 Jan 2015 21:53 question, complete

I have 2 channel, artists and artwork.

Is it possible to use with Low Search to search/show entries from the artwork channel where the relationship parent entry in the artist channel has the status 'Open'?

Replies

  1. Low 14 Jan 2015 09:51

    You could use the Relationships filter, but you'd have to generate the list of "open" parent IDs yourself.

    For example, use the query module or channel:entries tag to generate a pipe-separated list of entry IDs for the parents with status Open, and use an embed to feed that list to the Low Results tag.

  2. zizther 14 Jan 2015 10:09

    Thanks Low.

    Would that have performance issues if it were 100's of ids?

    At the moment the parent channel has 500 entries. only 200 have their status set to open, but this number will grow.
    Would sending Low Search 200+ id's be an issue?

  3. Low 14 Jan 2015 10:10

    Nah, should be OK.

  4. zizther 14 Jan 2015 10:12

    Great, thanks

  5. zizther 14 Jan 2015 11:11

    Presumably I can show these result without the user having to perform a search?
    So that I can use Low Search as an advanced Channel Entries

  6. Low 14 Jan 2015 12:25

    Yep. Just hard-code the params and it works just like a better version of the Channel Entries tag.

  7. zizther 14 Jan 2015 13:17

    Thanks for your help.
    That sorted the issue and saved a fair bit of time.

  8. zizther 14 Jan 2015 14:39

    Just realised what I had done is not actually working.

    Here is what I have

    Artists Channel
    - Title
    - Name

    Gallery Channel
    - Title
    - Image
    - Artist (relationship field)

    I am generating a list of all the artists with status open and passing that to the Low Search results tag via an embed.

    Here is the EE code:

    {exp:low_search:results
    channel="gallery"
    disable="member_data|category_fields"
    limit="16"
    paginate="bottom"
    parent:artwork_artist="{embed:entry_ids}"
    }

    What I presume that code says is get entries from the gallery channel where parent from the artwork_artist field is 1,2 and 3, however it produces no results.

    Have I got anything wrong or working with the filter incorrectly?

  9. Low 14 Jan 2015 16:46

    Technically, if the relationship field is in the Gallery channel, an Artist entry is a child of a Gallery entry. So you'd need to use child:artwork_artist="{embed:entry_ids}" instead.

  10. Low 15 Jan 2015 14:33

    If you upgrade to (just released) v3.4.0, you could try and use SQL parameters: http://gotolow.com/addons/low-search/...

  11. zizther 15 Jan 2015 20:16

    Amazing. Thanks Low.

    I did try changing the parameter to child but still didn't work. But the SQL query in the parameter did...
    Thanks for the update and thanks for the support.

    Very much appreciated.

  12. zizther 23 Mar 2015 23:56

    Hi Low

    I wondered if you could help me with a SQL query in Low Search, it is based on the same issue as above.

    I am showing an artist from the artist channel, I now wants to show all the related (parent) entries from the gallery channel.
    I want to use Low Search because I can paginate the entries, whereas I can't with the native relationship tags.

    What is the query I should use, I have tried a few things but nothing is working, I presume because I am not understanding it correctly.
    Here is what I have tried

    parent:artwork_artist="SELECT parent_id FROM exp_relationships WHERE child_id = '{embed:entry_id}';-1"

    child="SELECT parent_id FROM exp_relationships WHERE child_id = '{embed:entry_id}';-1"

    {embed:entry_id} is the artist channel entry id.

    Thanks for your help

  13. Low 24 Mar 2015 10:18

    You can actually do this with the regular Relationships filter, without using SQL parameters. You're after all entries from the 'gallery' channel that have the given Artist entry as a child, right? (presuming you're selecting an artist for a gallery entry)

    In that case, you can use:

    channel="gallery" child:artwork_artist="{embed:entry_id}"

  14. zizther 24 Mar 2015 21:32

    As always superb support and a much appreciated add-on!
    Full of features and very powerful!

    Thanks again!