SearchService
The SearchService service is used handle the interactions with the external systems. It can be extended and overridden if needed. A normal project shouldn't need to provide its own service and achieve all customizations through custom search provider.
import { SearchService } from '@archibald/search';
In order to use the SearchService service, you need to inject it by using the Inject decorator function.
@Inject()
protected authService: AuthService;
searchByTerm
This method calls searchByTerm method defined on a provided search provider and returns response.
const response = this.searchService.searchByTerm();
searchByCategory
This method calls searchByCategory method defined on a provided search provider and returns response.
const response = this.searchService.searchByCategory();
response
| Name | Type | Description | Default |
|---|---|---|---|
| breadcrumbs | BreadcrumbItem[] | Breadcrumbs for the search results | |
| currentQuery | CurrentSearchQuery | undefined | The current URL and the search query | |
| pagination | Pagination | Contains information about current page, number of pages, products per page and number of products | |
| products | Product[] | List of products or search results |