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

Support archive

Search in custom field

ngoncom 30 Jul 2015 11:08 question, complete

Hi Low!

I want to search keyword only in one custom field, so I write:

{exp:low_search:results keyword="4" search:car_id channel="cars" ...} 
{title}
{/exp:low_search:results}


Above code, I only want to search in custom field (car_id) (not search in another field) in channel (cars) which have car_id = 4.

I wonder my above code right?

Thank so much!

Replies

  1. Low 30 Jul 2015 11:11

    No, you're better off using the Field Search filter:

    {exp:low_search:results channel="cars" search:car_id="=4" ...}

  2. ngoncom 30 Jul 2015 13:35

    Thank for your advice!

    Now, for dynamic purpose I replace "4" with "{member_id}".

    {exp:low_search:results channel="cars" search:car_id="={member_id}" ...}


    Above code NOT working!

    I try to use stash but still not luck. Do I have to using Mo' Variables? (I really dont want install Mo' Variables for this only).

    Thank for your time!

  3. Low 30 Jul 2015 13:38

    That's because {member_id} isn't parsed early enough to be used as a tag parameter value. You should install Mo' Variables, because then you could use {logged_in_member_id}, which is parsed early.

  4. ngoncom 30 Jul 2015 13:43

    Thank so much, Low!

    You saved my life!