---
title: "Facet"
generated: true
---
<GenerationInfo sourceFile="packages/core/src/entity/facet/facet.entity.ts" sourceLine="25" packageName="@vendure/core" />

A Facet is a class of properties which can be applied to a <DocsLink href="/reference/typescript-api/entities/product#product">Product</DocsLink> or <DocsLink href="/reference/typescript-api/entities/product-variant#productvariant">ProductVariant</DocsLink>.
They are used to enable [faceted search](https://en.wikipedia.org/wiki/Faceted_search) whereby products
can be filtered along a number of dimensions (facets).

For example, there could be a Facet named "Brand" which has a number of <DocsLink href="/reference/typescript-api/entities/facet-value#facetvalue">FacetValue</DocsLink>s representing
the various brands of product, e.g. "Apple", "Samsung", "Dell", "HP" etc.

```ts title="Signature"
class Facet extends VendureEntity implements Translatable, HasCustomFields, ChannelAware {
    constructor(input?: DeepPartial<Facet>)
    name: LocaleString;
    @Column({ default: false })
    isPrivate: boolean;
    @Column({ unique: true })
    code: string;
    @OneToMany(type => FacetTranslation, translation => translation.base, { eager: true })
    translations: Array<Translation<Facet>>;
    @OneToMany(type => FacetValue, value => value.facet)
    values: FacetValue[];
    @Column(type => CustomFacetFields)
    customFields: CustomFacetFields;
    @ManyToMany(type => Channel, channel => channel.facets)
    @JoinTable()
    channels: Channel[];
}
```
* Extends: <DocsLink href="/reference/typescript-api/entities/vendure-entity#vendureentity">`VendureEntity`</DocsLink>


* Implements: <DocsLink href="/reference/typescript-api/entities/interfaces#translatable">`Translatable`</DocsLink>, HasCustomFields, <DocsLink href="/reference/typescript-api/entities/interfaces#channelaware">`ChannelAware`</DocsLink>



<div className="members-wrapper">

### constructor

<MemberInfo kind="method" type={`(input?: DeepPartial<<a href='/reference/typescript-api/entities/facet#facet'>Facet</a>>) => Facet`}   />


### name

<MemberInfo kind="property" type={`LocaleString`}   />


### isPrivate

<MemberInfo kind="property" type={`boolean`}   />


### code

<MemberInfo kind="property" type={`string`}   />


### translations

<MemberInfo kind="property" type={`Array<Translation<<a href='/reference/typescript-api/entities/facet#facet'>Facet</a>>>`}   />


### values

<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/facet-value#facetvalue'>FacetValue</a>[]`}   />


### customFields

<MemberInfo kind="property" type={`CustomFacetFields`}   />


### channels

<MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/channel#channel'>Channel</a>[]`}   />




</div>
