Can the Auto suggest results count be changed in SXA?











up vote
4
down vote

favorite












I'm using Sitecore 9 update 1 with SXA 1.7, I configured the auto suggester in the Solr, the suggest.count is 30 and the maximum predictive results count for the SXA search box is 30 also, but the returning results is always 5 although there is more data indexed in the Solr, I tried many things like changing numbers or removing it but still the same.



Here is my configuration for the auto suggester :



<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">sxaSuggester</str>
<str name="lookupImpl">BlendedInfixLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="contextField">_language</str>
<str name="field">suggestion_s</str>
<str name="suggestAnalyzerFieldType">text_suggester</str>
<str name="payloadField">templatedisplayname_s</str>
<str name="buildOnStartup">true</str>
<str name="buildOnCommit">false</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy" >
<lst name="defaults">
<str name="suggest.dictionary">sxaSuggester</str>
<str name="suggest">true</str>
<str name="suggest.onlyMorePopular">true</str>
<str name="suggest.count">30</str>
<str name="suggest.collate">true</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>









share|improve this question




























    up vote
    4
    down vote

    favorite












    I'm using Sitecore 9 update 1 with SXA 1.7, I configured the auto suggester in the Solr, the suggest.count is 30 and the maximum predictive results count for the SXA search box is 30 also, but the returning results is always 5 although there is more data indexed in the Solr, I tried many things like changing numbers or removing it but still the same.



    Here is my configuration for the auto suggester :



    <searchComponent name="suggest" class="solr.SuggestComponent">
    <lst name="suggester">
    <str name="name">sxaSuggester</str>
    <str name="lookupImpl">BlendedInfixLookupFactory</str>
    <str name="dictionaryImpl">DocumentDictionaryFactory</str>
    <str name="contextField">_language</str>
    <str name="field">suggestion_s</str>
    <str name="suggestAnalyzerFieldType">text_suggester</str>
    <str name="payloadField">templatedisplayname_s</str>
    <str name="buildOnStartup">true</str>
    <str name="buildOnCommit">false</str>
    </lst>
    </searchComponent>
    <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy" >
    <lst name="defaults">
    <str name="suggest.dictionary">sxaSuggester</str>
    <str name="suggest">true</str>
    <str name="suggest.onlyMorePopular">true</str>
    <str name="suggest.count">30</str>
    <str name="suggest.collate">true</str>
    </lst>
    <arr name="components">
    <str>suggest</str>
    </arr>
    </requestHandler>









    share|improve this question


























      up vote
      4
      down vote

      favorite









      up vote
      4
      down vote

      favorite











      I'm using Sitecore 9 update 1 with SXA 1.7, I configured the auto suggester in the Solr, the suggest.count is 30 and the maximum predictive results count for the SXA search box is 30 also, but the returning results is always 5 although there is more data indexed in the Solr, I tried many things like changing numbers or removing it but still the same.



      Here is my configuration for the auto suggester :



      <searchComponent name="suggest" class="solr.SuggestComponent">
      <lst name="suggester">
      <str name="name">sxaSuggester</str>
      <str name="lookupImpl">BlendedInfixLookupFactory</str>
      <str name="dictionaryImpl">DocumentDictionaryFactory</str>
      <str name="contextField">_language</str>
      <str name="field">suggestion_s</str>
      <str name="suggestAnalyzerFieldType">text_suggester</str>
      <str name="payloadField">templatedisplayname_s</str>
      <str name="buildOnStartup">true</str>
      <str name="buildOnCommit">false</str>
      </lst>
      </searchComponent>
      <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy" >
      <lst name="defaults">
      <str name="suggest.dictionary">sxaSuggester</str>
      <str name="suggest">true</str>
      <str name="suggest.onlyMorePopular">true</str>
      <str name="suggest.count">30</str>
      <str name="suggest.collate">true</str>
      </lst>
      <arr name="components">
      <str>suggest</str>
      </arr>
      </requestHandler>









      share|improve this question















      I'm using Sitecore 9 update 1 with SXA 1.7, I configured the auto suggester in the Solr, the suggest.count is 30 and the maximum predictive results count for the SXA search box is 30 also, but the returning results is always 5 although there is more data indexed in the Solr, I tried many things like changing numbers or removing it but still the same.



      Here is my configuration for the auto suggester :



      <searchComponent name="suggest" class="solr.SuggestComponent">
      <lst name="suggester">
      <str name="name">sxaSuggester</str>
      <str name="lookupImpl">BlendedInfixLookupFactory</str>
      <str name="dictionaryImpl">DocumentDictionaryFactory</str>
      <str name="contextField">_language</str>
      <str name="field">suggestion_s</str>
      <str name="suggestAnalyzerFieldType">text_suggester</str>
      <str name="payloadField">templatedisplayname_s</str>
      <str name="buildOnStartup">true</str>
      <str name="buildOnCommit">false</str>
      </lst>
      </searchComponent>
      <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy" >
      <lst name="defaults">
      <str name="suggest.dictionary">sxaSuggester</str>
      <str name="suggest">true</str>
      <str name="suggest.onlyMorePopular">true</str>
      <str name="suggest.count">30</str>
      <str name="suggest.collate">true</str>
      </lst>
      <arr name="components">
      <str>suggest</str>
      </arr>
      </requestHandler>






      sxa content-search






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 18 at 17:19









      Tamas Varga Sitecore

      2,5661953




      2,5661953










      asked Nov 15 at 7:14









      Mohamed Mosa

      622




      622






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          Unfortunately, it's hardcoded to have 5 suggestions. It definitely shouldn't be done that way and I will register a task in our backlog to change it and make it configurable.



          As a workaround, you could override SolrSuggester or implement your own suggester by creating a class which implements ISuggester interface. At the end just replace SXA implementation by your one in the DI container.



          You can pass a number of suggestions like that:



          SuggestHandlerQueryOptions options = new SuggestHandlerQueryOptions
          {
          Parameters = new SuggestParameters
          {
          Count = NUMBER_OF_SUGGESTIONS
          }
          }


          Investigate Sitecore.XA.Foundation.VersionSpecific.Services.SolrSuggester to have a full picture how the implementation should look like.






          share|improve this answer























          • Thanks so much, I implemented my own suggester, but need to know where to reference it from Sitecore configuration.
            – Mohamed Mosa
            Nov 15 at 9:52










          • We are registering it in the Sitecore.XA.Foundation.VersionSpecific.config file - section services. But what you need to do is to replace existing implementation by your own one, you can do it in the C# code (a lot of examples, just google it).
            – Dawid Rutkowski
            Nov 15 at 10:24










          • Great, I did it and it returns the count I desired, but still only 5 results are rendered, I checked the solr request and it's correct, but in the component-search-box.js, the suggestion: function (data) (which render the suggestion results)are called 5 times only. Is the count 5 is hard-coded somewhere else ?
            – Mohamed Mosa
            Nov 15 at 11:29












          • I don't think so. Ensure that you've properly replaced SXA implementation in the DI container.
            – Dawid Rutkowski
            Nov 16 at 11:02











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "664"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsitecore.stackexchange.com%2fquestions%2f14946%2fcan-the-auto-suggest-results-count-be-changed-in-sxa%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          4
          down vote



          accepted










          Unfortunately, it's hardcoded to have 5 suggestions. It definitely shouldn't be done that way and I will register a task in our backlog to change it and make it configurable.



          As a workaround, you could override SolrSuggester or implement your own suggester by creating a class which implements ISuggester interface. At the end just replace SXA implementation by your one in the DI container.



          You can pass a number of suggestions like that:



          SuggestHandlerQueryOptions options = new SuggestHandlerQueryOptions
          {
          Parameters = new SuggestParameters
          {
          Count = NUMBER_OF_SUGGESTIONS
          }
          }


          Investigate Sitecore.XA.Foundation.VersionSpecific.Services.SolrSuggester to have a full picture how the implementation should look like.






          share|improve this answer























          • Thanks so much, I implemented my own suggester, but need to know where to reference it from Sitecore configuration.
            – Mohamed Mosa
            Nov 15 at 9:52










          • We are registering it in the Sitecore.XA.Foundation.VersionSpecific.config file - section services. But what you need to do is to replace existing implementation by your own one, you can do it in the C# code (a lot of examples, just google it).
            – Dawid Rutkowski
            Nov 15 at 10:24










          • Great, I did it and it returns the count I desired, but still only 5 results are rendered, I checked the solr request and it's correct, but in the component-search-box.js, the suggestion: function (data) (which render the suggestion results)are called 5 times only. Is the count 5 is hard-coded somewhere else ?
            – Mohamed Mosa
            Nov 15 at 11:29












          • I don't think so. Ensure that you've properly replaced SXA implementation in the DI container.
            – Dawid Rutkowski
            Nov 16 at 11:02















          up vote
          4
          down vote



          accepted










          Unfortunately, it's hardcoded to have 5 suggestions. It definitely shouldn't be done that way and I will register a task in our backlog to change it and make it configurable.



          As a workaround, you could override SolrSuggester or implement your own suggester by creating a class which implements ISuggester interface. At the end just replace SXA implementation by your one in the DI container.



          You can pass a number of suggestions like that:



          SuggestHandlerQueryOptions options = new SuggestHandlerQueryOptions
          {
          Parameters = new SuggestParameters
          {
          Count = NUMBER_OF_SUGGESTIONS
          }
          }


          Investigate Sitecore.XA.Foundation.VersionSpecific.Services.SolrSuggester to have a full picture how the implementation should look like.






          share|improve this answer























          • Thanks so much, I implemented my own suggester, but need to know where to reference it from Sitecore configuration.
            – Mohamed Mosa
            Nov 15 at 9:52










          • We are registering it in the Sitecore.XA.Foundation.VersionSpecific.config file - section services. But what you need to do is to replace existing implementation by your own one, you can do it in the C# code (a lot of examples, just google it).
            – Dawid Rutkowski
            Nov 15 at 10:24










          • Great, I did it and it returns the count I desired, but still only 5 results are rendered, I checked the solr request and it's correct, but in the component-search-box.js, the suggestion: function (data) (which render the suggestion results)are called 5 times only. Is the count 5 is hard-coded somewhere else ?
            – Mohamed Mosa
            Nov 15 at 11:29












          • I don't think so. Ensure that you've properly replaced SXA implementation in the DI container.
            – Dawid Rutkowski
            Nov 16 at 11:02













          up vote
          4
          down vote



          accepted







          up vote
          4
          down vote



          accepted






          Unfortunately, it's hardcoded to have 5 suggestions. It definitely shouldn't be done that way and I will register a task in our backlog to change it and make it configurable.



          As a workaround, you could override SolrSuggester or implement your own suggester by creating a class which implements ISuggester interface. At the end just replace SXA implementation by your one in the DI container.



          You can pass a number of suggestions like that:



          SuggestHandlerQueryOptions options = new SuggestHandlerQueryOptions
          {
          Parameters = new SuggestParameters
          {
          Count = NUMBER_OF_SUGGESTIONS
          }
          }


          Investigate Sitecore.XA.Foundation.VersionSpecific.Services.SolrSuggester to have a full picture how the implementation should look like.






          share|improve this answer














          Unfortunately, it's hardcoded to have 5 suggestions. It definitely shouldn't be done that way and I will register a task in our backlog to change it and make it configurable.



          As a workaround, you could override SolrSuggester or implement your own suggester by creating a class which implements ISuggester interface. At the end just replace SXA implementation by your one in the DI container.



          You can pass a number of suggestions like that:



          SuggestHandlerQueryOptions options = new SuggestHandlerQueryOptions
          {
          Parameters = new SuggestParameters
          {
          Count = NUMBER_OF_SUGGESTIONS
          }
          }


          Investigate Sitecore.XA.Foundation.VersionSpecific.Services.SolrSuggester to have a full picture how the implementation should look like.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 15 at 8:55

























          answered Nov 15 at 8:15









          Dawid Rutkowski

          3,118321




          3,118321












          • Thanks so much, I implemented my own suggester, but need to know where to reference it from Sitecore configuration.
            – Mohamed Mosa
            Nov 15 at 9:52










          • We are registering it in the Sitecore.XA.Foundation.VersionSpecific.config file - section services. But what you need to do is to replace existing implementation by your own one, you can do it in the C# code (a lot of examples, just google it).
            – Dawid Rutkowski
            Nov 15 at 10:24










          • Great, I did it and it returns the count I desired, but still only 5 results are rendered, I checked the solr request and it's correct, but in the component-search-box.js, the suggestion: function (data) (which render the suggestion results)are called 5 times only. Is the count 5 is hard-coded somewhere else ?
            – Mohamed Mosa
            Nov 15 at 11:29












          • I don't think so. Ensure that you've properly replaced SXA implementation in the DI container.
            – Dawid Rutkowski
            Nov 16 at 11:02


















          • Thanks so much, I implemented my own suggester, but need to know where to reference it from Sitecore configuration.
            – Mohamed Mosa
            Nov 15 at 9:52










          • We are registering it in the Sitecore.XA.Foundation.VersionSpecific.config file - section services. But what you need to do is to replace existing implementation by your own one, you can do it in the C# code (a lot of examples, just google it).
            – Dawid Rutkowski
            Nov 15 at 10:24










          • Great, I did it and it returns the count I desired, but still only 5 results are rendered, I checked the solr request and it's correct, but in the component-search-box.js, the suggestion: function (data) (which render the suggestion results)are called 5 times only. Is the count 5 is hard-coded somewhere else ?
            – Mohamed Mosa
            Nov 15 at 11:29












          • I don't think so. Ensure that you've properly replaced SXA implementation in the DI container.
            – Dawid Rutkowski
            Nov 16 at 11:02
















          Thanks so much, I implemented my own suggester, but need to know where to reference it from Sitecore configuration.
          – Mohamed Mosa
          Nov 15 at 9:52




          Thanks so much, I implemented my own suggester, but need to know where to reference it from Sitecore configuration.
          – Mohamed Mosa
          Nov 15 at 9:52












          We are registering it in the Sitecore.XA.Foundation.VersionSpecific.config file - section services. But what you need to do is to replace existing implementation by your own one, you can do it in the C# code (a lot of examples, just google it).
          – Dawid Rutkowski
          Nov 15 at 10:24




          We are registering it in the Sitecore.XA.Foundation.VersionSpecific.config file - section services. But what you need to do is to replace existing implementation by your own one, you can do it in the C# code (a lot of examples, just google it).
          – Dawid Rutkowski
          Nov 15 at 10:24












          Great, I did it and it returns the count I desired, but still only 5 results are rendered, I checked the solr request and it's correct, but in the component-search-box.js, the suggestion: function (data) (which render the suggestion results)are called 5 times only. Is the count 5 is hard-coded somewhere else ?
          – Mohamed Mosa
          Nov 15 at 11:29






          Great, I did it and it returns the count I desired, but still only 5 results are rendered, I checked the solr request and it's correct, but in the component-search-box.js, the suggestion: function (data) (which render the suggestion results)are called 5 times only. Is the count 5 is hard-coded somewhere else ?
          – Mohamed Mosa
          Nov 15 at 11:29














          I don't think so. Ensure that you've properly replaced SXA implementation in the DI container.
          – Dawid Rutkowski
          Nov 16 at 11:02




          I don't think so. Ensure that you've properly replaced SXA implementation in the DI container.
          – Dawid Rutkowski
          Nov 16 at 11:02


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsitecore.stackexchange.com%2fquestions%2f14946%2fcan-the-auto-suggest-results-count-be-changed-in-sxa%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Сан-Квентин

          Алькесар

          Josef Freinademetz