on ‎2019 Feb 04 12:32 PM
Hi Guys, while searching i am able to see autosuggestion by product name and code, and here i don't want to show the autosuggestions by code while searching. How can i handle this is Front end ? or is there any code changes required to hide Product code while searching ?
Request clarification before answering.
You should be able to just mark the code column as a non autocomplete field
In Backoffice navigate to System -> Search and Navigation -> Indexed Types
Select your product type
Go to the Indexed Properties tab
Scroll down to code and press the 3 dots icon and choose Edit Details from the menu
Find Use for auto-complete and uncheck it
Save
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the below method, after disabling autocomplete for product code, component.isDisplaySuggestions() method will be still called or will it only get results from component.isDisplayProducts()?
@ResponseBody
@RequestMapping(value = "/autocomplete/" + COMPONENT_UID_PATH_VARIABLE_PATTERN, method = RequestMethod.GET)
public AutocompleteResultData getAutocompleteSuggestions(@PathVariable final String componentUid,
@RequestParam("term") final String term) throws CMSItemNotFoundException
{
final AutocompleteResultData resultData = new AutocompleteResultData();
final SearchBoxComponentModel component = (SearchBoxComponentModel) cmsComponentService.getSimpleCMSComponent(componentUid);
**if (component.isDisplaySuggestions())
{
resultData.setSuggestions(subList(productSearchFacade.getAutocompleteSuggestions(term), component.getMaxSuggestions()));
}**
if (component.isDisplayProducts())
{
resultData.setProducts(subList(productSearchFacade.textSearch(term, SearchQueryContext.SUGGESTIONS).getResults(),
component.getMaxProducts()));
}
return resultData;
}
Eh? That's completely unrelated. displaySuggestions is a property of the component being displayed. You can change it in cmscockpit/smartedit or backoffice or just via some impex. Changing whether the code attribute is used in autocomplete doesn't affect the display of suggestions (other than there may be no matches if you start typing in a product code)
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.