Gravatar for noel.brennan@hpe.com

Question by Noel Brennan, Oct 2, 2018 9:16 AM

Specifying the number autosuggested results, is not working, when using -> data-number-of-suggestions.

Using data-number-of-suggestions="3" is not restricting the number of results to 3. How do we restrict the number of suggestions to 3. Five results are being returned but we want 3 results. Do I need to change the query suggestions count, if so how do I do this? Code Snippet below:

<div className="CoveoSearchbox" data-enable-omnibox="true" data-enable-field-addon="true" data-enable-wildcards="true" data-enable-partial-match="true" data-partial-match-keywords="3" data-number-of-suggestions="3" data-placeholder={placeHolder} >
          <div id="suggestedProducts" className="CoveoFieldSuggestions" data-field="@kmpmname" data-header-title="Suggested Products" data-number-of-suggestions="3" data-on-select="myOnSelectFunction"></div>
          <div id="resources" className="CoveoFieldSuggestions" data-field={keywords} data-header-title="Resources" data-number-of-suggestions="3" data-on-select="onResourceSelected" data-omnibox-z-index='0'></div>
        </div>

1 Reply
Gravatar for noel.brennan@hpe.com

Answer by Noel Brennan, Oct 2, 2018 1:33 PM

We found a fix by adding this to our code

Coveo.SearchEndpoint.endpoints.default = new Coveo.SearchEndpoint({

restUri: this.props.searchEndpoint,

accessToken: coveoAccessToken,

queryStringArguments: {

count: 7

}

});

Ask a question