0

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

1 Answer 1

0
  1. Unfortunately that isn't possible unless you use the search_in="" parameter (http://www.solspace.com/docs/super_search/results/#search_in), but search_word_within_words would still apply to all fields mentioned in search_in.

  2. To avoid displaying "No results matched your query." 4 times, try putting the {if super_search_keywords==""}...{/if} conditional outside of {exp:super_search:results}.

    Also, try wrapping the code inside {exp:super_search:results} with {if super_search_keywords != ""}...{/if} so that 1. results display only if keywords is filled out and 2. nothing displays when keywords is empty (by default Super Search would return entries otherwise)

3
  • Thank you, that worked exactly like we needed it to! I have a couple other questions as well I need help with. See the original post for more details.
    – B Mack
    Commented Nov 10, 2014 at 19:02
  • 4, 5, 6, then 1, 2, 3...? the OP is confusing to read now. Further, these should all be separate questions here on StackExchange. Since each question touches different subjects, can you please post these questions separately in new threads? Make sure to give each question a good, meaningful title for others to refer to in the future. Thanks! :)
    – Solspace
    Commented Nov 11, 2014 at 0:22
  • Sorry about that! I thought I was doing myself a favor by putting unsolved answers at the top. Since last post we've been able to solve all but one of these issues, so I posted that issue in a new post. I also posted the solution to our other issue just in case anyone else needs that information.
    – B Mack
    Commented Nov 12, 2014 at 15:17

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.