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>
sxa content-search
add a comment |
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>
sxa content-search
add a comment |
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>
sxa content-search
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
sxa content-search
edited Nov 18 at 17:19
Tamas Varga Sitecore
2,5661953
2,5661953
asked Nov 15 at 7:14
Mohamed Mosa
622
622
add a comment |
add a comment |
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.
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 theSitecore.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
add a comment |
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.
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 theSitecore.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
add a comment |
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.
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 theSitecore.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
add a comment |
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.
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.
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 theSitecore.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
add a comment |
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 theSitecore.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
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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