On the website http://constructionbook.bnibooks.com/, I'm trying to modify Super Search to get search on the website the way we want it, but I'm having some difficulties.
Super Search Version 2.1.4, Expression Engine Version 2.8.1
1. 'NO SOLUTION' Is there a way to have the parameter search_word_within_words apply to some searchable fields but not to others?
2. 'SOLVED' In order to make it so that an empty string returns no search results, I tried adding the conditional statement:
{if super_search_keywords==""}
<div class="col-md-12">
<p>No results matched your query.</p>
</div>
{/if}
However, any empty search string still paginates and now returns "No results matched your query." 4 times (with a long empty space in between time). I believe this is because it hasn't actually stopped displaying any products. How might I change the results so that if the search string is empty, we simply return 0 results?
3. 'SOLVED' Is there a way to, if super_search_total_results is equal to 1, redirect the user to the page for that result. In other words, there's only one result, so they should be take to that page. I have the conditional statement:
{if super_search_total_results==1}
{/if}
But I'm not sure what code to put in that statement that will redirect to the result. What might I write that would redirect the user to that page?
Edit: I was able to take care of #3 with a redirect tag that is built into ExpressionEngine
4. SOLVED On our old website, we had it set up so that some searches redirected to category pages. We have a large number of categories, so it would be impractical to simply write an {if} statement for each one.
Is there a way we can build a table and have super search read that table, so that if a user searches a specific term, we can redirect them to a specific category page?
Edit: I was able to take care of #6 with URL redirects using Detour Pro