1

EE v2.8.1 - Build Date: 20140314

I have a Grid field that is set to searchable, the columns are also set to searchable. It is in the about channel and is populated using the pages module. I have a simple search form and I continue to get '0' results. I even went so far as to specify the exact channel of the entry I was testing, copy and paste the text from the entry form itself, and still I return nothing.

I went into the field to re-save the field type thinking something was "off". I then went into the entry and re-saved the entry to make sure nothing was "out-of-sync".

My simple form is here:

            {exp:search:simple_form 
                channel="about" 
                where="any" 
                form_id="searchForm" 
                result_page="search/results" 
                no_result_page="search/no-results" 
                results="20" 
                show_future_entries="no" 
                status="open"
            }
                <div class="input-group">
                    <input type="text" class="form-control search" name="keywords" id="keywords" value="" placeholder="Search...">
                    <span class="input-group-btn">
                        <button type="submit" class="btn btn-default"><i class="icon icon-search"></i></button>
                    </span>
                </div>
            {/exp:search:simple_form}

I am currently using this to see what is returned, if anything.

            <h2>Your search for <em>{exp:search:keywords}</em> had <em>{exp:search:total_results}</em> results.</h2>

Am I doing something wrong here? I've never fought something so simple for so long.

* EDIT *

I have done some further testing with a new channel, new fieldset, and new entries. It appears that the rich text field inside of the grid is NOT being included in the search. I have ALL searchable fields selected and am not able to return any results from these entries.

3

WOW!!! I feel a little embarrassed on this one. I will still post the answer since I have seen several other posts in various sites, be it EllisLab support, here, or others. Another fine example of forgetting something very simple and why reviewing the docs on a regular basis is a great idea. ;)

Adding the following allowed the search of the entry inside the context of that entry:

  search_in="entries"

Per the docs:

search_in=

search_in="entries", search_in="everywhere", search_in="titles"

This parameter specifies which fields you would like to include in the searching. There are three possible values:

entries: The search will be conducted in the entry fields and titles of your channel. The associated comments will not be included.

everywhere: The search will be conducted in the title, entry fields, and in associated comments.

titles: The search will be conducted in the title of your entries. The channel entry fields and any associated comments will not be included. If this parameter is not set, the search will default to only search by “titles”.

* CONCLUSION * Changing my search tag to the following worked:

            {exp:search:simple_form 
                channel="not bogus" 
                search_in="entries" 
                where="any" 
                form_id="searchForm" 
                result_page="search/results" 
                no_result_page="search/no-results" 
                results="20" 
                show_future_entries="no" 
                status="open"
            }

* ADDED BONUS * If you would like to search in all channels of the site and don't want to worry about forgetting to go back and add one to your search parameters later, if a channel is added, add the following to your search parameters:

channel="not bogus"

By using the not in conjunction with a channel name not used, you will search in all channels not named that. Then you simply have to set your searchable flags accordingly in your field sets.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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