2

When I check the checkbox for "Is field searchable?", what exactly does that offer me? I assume that means I can use that field in the Channel entries tag pair, such as:

search:body="pickles"

Is this correct?

What if I provided my users with a search form (with a number of fields)? How can take those form entries and pass it on to the Channel entry tag pair in order to do the search?

Just a sidenote: My preference for search is for the URL to update in the address box, but not to load the page, and the page gets update via Ajax. However, that URL can be used to directly access the search results still.

3 Answers 3

4

Actually, the "Is field searchable?" checkbox relates only to the native Search module.

The search parameter on the Channel Entries tag is only the most basic way to handle searches in EE. Your other native option is to use the Search module, specifically the Advanced Search Form. But it is somewhat limited, and its URLs are not bookmark-able (as they eventually expire), nor are they at all human-readable.

What you'll be most happy with is Super Search or Low Search. Well worth the money for either, they are both excellent search modules.

2
  • Thanks Derek. I'll review both. What are your thoughts/experiences on these search modules? Dec 21, 2012 at 13:24
  • I've used SuperSearch with great success. I've never used Low Search, but I trust Low as a fantastic developer. Review their specs to see which hits the points you need though. Dec 21, 2012 at 13:27
2

Low search is great, only just coming to it recently and its very flexible.

Just a note too

Actually, the "Is field searchable?" checkbox relates only to the native Search module.

I am pretty sure supersearch and low search won't find a search in your field unless this is ticked .

1
  • Thanks for the clarification Aaron, I was unaware of that. Also, this should likely be a comment on my answer, as it's not an answer in and of itself. Dec 28, 2012 at 13:19
2

I did a entries search using post for a quiz type feature in a web site I built back in February. I also wrote up the entire process here.

Copying and pasting a good section of that blog entry here:

First up, build a channel called quiz results. with five fields. The first for field types need to be drop downs - I called mine {question-one}, {question-two}, {question-three} and {question-four} and populated with the answers a, b, c each on a new line. The last field is a relationship field which will be the product that the results link to, I called this {question-result}. Now start the data entry creating entries for each possible combination of answers.

Next build a basic form with radio buttons for the answer. You'll also need some way to get the $POST data into the quiz results page to pull up the correct answer. I thought about using strait php, but didn't want to enable php on my templates so looked to devot:ee for an add-on and found a few. The one that I chose looked best and is dead simple to use: EvoPost.

Next you need to create a new template called evopost (or whatever you want it to be) and set the action="" to point to that template like this action="{site_url}/template_group/evopost" and then in the evopost template you add the following code where you prefix the name="" value of each field with ep_ so if your field is name="old" then your post data would be {ep_old}:

{exp:evopost:getpostdata}
  {redirect="/treat-matchmaker/results/{ep_old}/{ep_big}/{ep_name}/{ep_foobar}"}
{/exp:evopost:getpostdata}

This then redirects to the results template where Where your channel entries tag then pulls this information from the url structure like this

{exp:channel:entries
  channel="matchmaker"
  search:question-one="{segment_3}"
  search:question-two="{segment_4}"
  search:question-three="{segment_5}"
  search:question-four="{segment_6}"
  disable="pagination|member_data"
}

To me this sounds almost exactly like what you need/want to do, except for the ajax part.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.