I’ve just gone live with a revamp of my employers’ website:
However, the search seems to produce too many results, as if it is searching the whole page rather than the entries. So, for example, a search on
public views
produces 101 results (there are 352 entries in the system, so it’s not returning all of them). On many of the pages, the only mention of “public” on the page is in the navigation bar (as part of “publication”) and in a side-advert.
Here’s the Simple Search template I’m embedding:
{exp:search:simple_form channel="about|blog|course|event|news|person|publication|research_group|research_project" search_in="entries" where="all"}
<div class=“searchbox”> Search <div class=“boxes”><div class=“inputbox”><input type=“text” name=“keywords” id=“keywords” maxlength=“100” size=“20”></div><div class=“inputbutton”><input type=“submit” value=“go”></div></div></div>
</div>
{/exp:search:simple_form}
and here is the guts of the Search Results page:
{exp:search:search_results limit="10" paginate="bottom"}
{channel}
{if channel_short_name=="about"}
{if about_title!=""}{about_title}{if:else}{title}{/if}
{/if}
{if channel_short_name=="course"}
{if course_name!=""}{course_name}{if:else}{title}{/if}
{/if}
{if channel_short_name=="news"}
news date: {entry_date format="%j %F %Y"}
{if news_headline!=""}{news_headline}{if:else}{title}{/if}
{/if}
{if channel_short_name=="event"}
event date: {event_start format="%j %F %Y"}
{if event_title!=""}{event_title}{if:else}{title}{/if}
{/if}
{if channel_short_name=="publication"}
publication date: {publication_date format="%F %Y"}
{if publication_title!=""}{publication_title}{if:else}{title}{/if}
{/if}
{if channel_short_name=="research_group"}
{if research_group_name!=""}{research_group_name}{if:else}{title}{/if}
{/if}
{if channel_short_name=="research_project"}
project start: {research_project_start_date format="%F %Y"}
{if research_project_name!=""}{research_project_name}{if:else}{title}{/if}
{/if}
{if channel_short_name=="person"}
{person_job_title}
{/if}
{if channel_short_name=="blog"}
blog date: {entry_date format="%j %F %Y"}
{/if}
{paginate}
{pagination_links}
{/paginate}
{/exp:search:search_results}
I’m currently running 2.4.0 (I know, I know, I’ll update it soon…)