1 Reply Latest reply: Jul 2, 2014 1:30 PM by 2703110 RSS

    Did you mean Endeca/ATG!

    2703110

      Hello,

       

         I'm trying to get search suggestions to the render "did you mean?" words in my cartridge SearchAdjustments of my web page, but the list that should have the search suggestions is always empty. However, the adjusted terms that apparently works in the same way works fine. Somebody knows what's missing to get the suggested seaches?

       

      Here's my render's code:

       

      <dsp:page>

       

                     <dsp:importbean bean="/atg/endeca/assembler/cartridge/manager/DefaultActionPathProvider" />

       

                      <dsp:getvalueof var="actionPath" bean="DefaultActionPathProvider.defaultExperienceManagerNavigationActionPath" />

                      <dsp:getvalueof var="contentItem" vartype="com.endeca.infront.assembler.ContentItem" value="${originatingRequest.contentItem}" />

       

                       <c:if test="${not empty contentItem.originalTerms}">

                                <div class="SearchAdjustmens">

                                      <div>

                                           <c:forEach var="originalTerm" items="${contentItem.originalTerms}" varStatus="status">

                                                <c:if test="${not empty contentItem.adjustedSearches[originalTerm]}">

                                                     Sua pesquisa por <span style="font-weight: bold;">${originalTerm}</span> foi corrigida para

                                                          <c:forEach var="adjustment" items="${contentItem.adjustedSearches[originalTerm]}" varStatus="status">

                                                               <span class="autoCorrect">${adjustment.adjustedTerms}</span>

                                                               <c:if test="${!status.last}">, </c:if>

                                                          </c:forEach>

                                                </c:if>

                                                <c:if test="${not empty contentItem.suggestedSearches[originalTerm]}">

                                                      Você quis dizer

                                                         <c:forEach var="suggestion" items="${contentItem.suggestedSearches[originalTerm]}" varStatus="status">

                                                             <c:set var="label">

                                                                 ${suggestion.label}

                                                                 <c:if test="${not empty suggestion.count}">

                                                                       (${suggestion.count} resultados)

                                                                 </c:if>

                                                             </c:set>

                                                             <a href="<c:out value="${suggestion.navigationSite}" />">${suggestion.label}</a>?

                                                         </c:forEach>

                                                         <br/>

                                              </c:if>

                                     </c:forEach>

                                  </div>

                              </div>

                          </c:if>

      </dsp:page>

       

      PS: contentItem.adjustedSearches works fine, but contentItem.suggestedSearches is always empty no matter how term I put on the search box.

        • 1. Re: Did you mean Endeca/ATG!
          2703110

          Eu solved the problem!

           

          It was missing configure a SearchAdjustmentsConfig with setSpellSuggestionEnabled(true) and setPhraseSuggestionEnabled(true)

          In my case I created a property root/config/atg/endeca/assembler/cartridge/handler/config/SearchAdjustmentsConfig.properties with the following content:

           

          $class=com.endeca.infront.cartridge.SearchAdjustmentsConfig

          phraseSuggestionEnabled=true

          spellSuggestionEnabled=true

           

          Now the MDEX is populating the contentItem.suggestedSearches. The contentItem.adjustedSearches was already working fine because it's all setting automatically.

           

          Thanks anyway!