Step-by-step Add Facet Component
- Create a class file type in ui/src/app/facet_framework/types
- Extend class from BaseFacet
- Add logic and overwrites as seen fit
- Add the new type to the FieldTypes in ui/src/app/field_framework/types/dynamic-field.ts
- Add type constructor to ui/src/app/field_framework/types/field-factory.ts
Step-by-step Add Facet Type
- Go to ui/src/app/facet_framework/components
- In console execute ng generate component <component-name>
- Extend the component from AbstractFacet
- Modify the new component as seen fit
- Go to ui/src/app/facet_framework/directive/facet-generator.directive.ts
- Add the component implementation
Step-by-step Implement Facet & Filter
- Go to ui/src/app/facet_framework/filter.service.ts
- Add logic to send the filter, normally it would be on buildSearchQueryFacets
- Go to server/qpl-elastic/elasticPayloadBuilder.js
- Add the new facet query in buildQueryAggregation
- Add the new filter in buildQueryFilter
Related articles