Creates an array of FacetGroups for searching
You can use multiple FacetGroups to combine them with an AND operation. Inside a FacetGroup, you can use multiple Facets to combine them with an OR operation.
The facet groups
// Search for projects with the category "forge" and the version "1.16.5" or "1.17.1"
const searchFacets = new SearchFacets(
// Combined with AND
new FacetGroup(
new Facet(FacetType.Categories, FacetOperation.EQUALS, "forge")
),
new FacetGroup(
// Combined with OR
new Facet(FacetType.Versions, FacetOperation.EQUALS, "1.16.5"),
new Facet(FacetType.Versions, FacetOperation.EQUALS, "1.17.1")
)
);
Adds a facet group to the search
The facet group to add
The search facets
Stringifies the search facets
The stringified search facets (e.g. [["categories:forge"], ["versions:1.16.5", "versions:1.17.1"]])
Represents an array of FacetGroups for searching
You can use multiple FacetGroups to combine them with an AND operation. Inside a FacetGroup, you can use multiple Facets to combine them with an OR operation.
Example