<p>According to <a href="http://buildwithcraft.com/docs/searching#supported-syntaxes" rel="nofollow">this page</a>, this is how it's done:</p>

<pre><code>{% set entries = craft.entries.search('interest:interestSearchValue destination:destinationSearchValue) %}
</code></pre>

<p>So, using the posted variables:</p>

<pre><code>{% set entries = craft.entries.search('interest:' ~ craft.request.param('interest') ~ ' destination:' ~ craft.request.param('destination')) %}
</code></pre>

CC BY-SA 3.0
2015-08-03T15:18:58.223Z
Thanks Paul.

This certainly helped - although it appears you don't need the AND in there, a space will suffice.

Search is not working as expected, thanks again for your help.
toffeejay
CC BY-SA 3.0
2015-08-03T15:29:12.130Z
*Search is now working (correction from above).
toffeejay
CC BY-SA 3.0
2015-08-03T15:31:11.743Z
Ah, no AND. That WAS an assumption, based on the OR I saw ...
Paul
CC BY-SA 3.0
2015-08-03T14:50:15.477Z
2015-08-03T17:10:26.090Z
2015-08-03T17:10:26.090Z
Paul
<p>I have a form that consists of two dropdown boxes. These dropdowns contain values that relate to two sets of categories for one type of entry.</p>

<p>So when the search form is submitted there are two params that are passed, an interest and a destination.</p>

<p>The result I need, if I were to write it literally would be:</p>

<p>Select all the courses where INTEREST = [interest] <strong>AND</strong> DESTINATION = [destination]</p>

<p>Having a hard time figuring out how this is done in Craft.</p>

<p>Any help appreciated. </p>

<entries><search>
Search entries based on two form values
# Search entries based on two form values

(Asked by: username_0 on 2015-08-03)

I have a form that consists of two dropdown boxes. These dropdowns contain values that relate to two sets of categories for one type of entry.

So when the search form is submitted there are two params that are passed, an interest and a destination.

The result I need, if I were to write it literally would be:

Select all the courses where INTEREST = [interest] **AND** DESTINATION = [destination]

Having a hard time figuring out how this is done in Craft.

Any help appreciated.

**Tags:** entries, search


---

## 1 answers

### Answer by username_1 on 2015-08-03. Score: 2 | Accepted answer

According to this page, this is how it's done:
{% set entries = craft.entries.search('interest:interestSearchValue destination:destinationSearchValue) %}

So, using the posted variables:
{% set entries = craft.entries.search('interest:' ~ craft.request.param('interest') ~ ' destination:' ~ craft.request.param('destination')) %}

> **Comments:**
> **username_0**: Thanks username_1.  This certainly helped - although it appears you don't need the AND in there, a space will suffice.  Search is not working as expected, thanks again for your help.  
> **username_0**: *Search is now working (correction from above).  
> **username_1**: Ah, no AND. That WAS an assumption, based on the OR I saw ...  

---

