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

Support archive

Using a custom field search without affecting results from other collections

Stephen 10 Mar 2014 01:27 question, complete

Hi Low,

I've got a search that searches across three collections (each collection uses a different channel).

In the search results, I'd like to make sure that the results from one particular channel only include entries where a custom field equals a certain value.

This seemed to work if I added this to the search results tag: search:cf_schemes_year="2014" Though interestingly, and maybe related to the other thread I just posted, it doesn't work when entering it into the search form tag.

However, even though I thought this custom field search worked, I've just noticed that it affects the collections that don't contain this custom field too, so means that I don't get any results from those collections/channels.

Do you know if there's a way around this issue at all? So that I get all results from the other two channels, but the filter results based on this custom field with the channel that contains this custom field?

Thanks,

Stephen

Replies

  1. Low 10 Mar 2014 06:37

    Yeah, this is combining AND and OR parameters, and isn't possible. All parameters given apply to all entries, regardless of collection or channel.

    If you want a way around it, you'd have to extend LS with a custom extension or filter.

  2. Stephen 11 Mar 2014 16:59

    Hi Low,

    Thanks for your reply. I'm going to work around this with the use of custom statuses for now. So for the channel where I don't want some/most entries to appear in the search results, I'm going to change their status to Hidden, and leave the entries I do want to appear as open.

    Thanks,

    Stephen