Product filtering and search module for the Unchained Engine
npm install @unchainedshop/core-filters

Filter and search module for the Unchained Engine. Provides product filtering, faceted search, and filter option management.
``bash`
npm install @unchainedshop/core-filters
`typescript
import { configureFiltersModule, FilterType } from '@unchainedshop/core-filters';
const filtersModule = await configureFiltersModule({ db });
// Create a filter
const filterId = await filtersModule.create({
key: 'color',
type: FilterType.MULTI_CHOICE,
});
// Search with filters
const result = await filtersModule.search.searchProducts({
filterQuery: { color: ['red', 'blue'] },
assortmentId: 'category-123',
});
`
| Export | Description |
|--------|-------------|
| configureFiltersModule | Configure and return the filters module |
| Method | Description |
|--------|-------------|
| findFilter | Find filter by ID or key |findFilters
| | Find filters with filtering and pagination |count
| | Count filters matching query |filterExists
| | Check if filter exists |
| Method | Description |
|--------|-------------|
| create | Create a new filter |update
| | Update filter data |delete
| | Soft delete a filter |
| Method | Description |
|--------|-------------|
| createFilterOption | Add option to filter |updateFilterOption
| | Update filter option |removeFilterOption
| | Remove filter option |
| Method | Description |
|--------|-------------|
| findFilterTexts | Find localized filter texts |updateTexts
| | Update filter texts |
| Method | Description |
|--------|-------------|
| search.searchProducts | Search products with filters |search.searchAssortments
| | Search assortments |
| Export | Description |
|--------|-------------|
| FilterType | Filter types (SWITCH, SINGLE_CHOICE, MULTI_CHOICE, RANGE) |
| Export | Description |
|--------|-------------|
| filtersSettings | Access filter module settings |
| Export | Description |
|--------|-------------|
| Filter | Filter document type |FilterOption
| | Filter option type |FilterQuery
| | Query parameters type |FiltersModule
| | Module interface type |SearchQuery
| | Search query type |
| Event | Description |
|-------|-------------|
| FILTER_CREATE | Filter created |FILTER_UPDATE
| | Filter updated |FILTER_REMOVE` | Filter deleted |
|
EUPL-1.2