Skip to content

Conversation

@aandrukhovich
Copy link

Add V2 Facets and Searchabilities API Support

Summary

This PR adds support for the V2 versions of the /v2/facets and /v2/searchabilities endpoints, running in parallel with the existing V1 implementations.

Changes

New Facets V2 Methods

  • CreateFacetConfigV2 - Create a single facet configuration
  • GetAllFacetConfigsV2 - Retrieve all facet configurations with pagination
  • GetFacetConfigV2 - Get a specific facet by name
  • CreateOrReplaceFacetConfigsV2 - Batch create or replace facets (PUT)
  • BatchPartiallyUpdateFacetConfigsV2 - Batch partial update facets (PATCH)
  • ReplaceFacetConfigV2 - Replace a single facet configuration
  • PartiallyUpdateFacetConfigV2 - Partially update a single facet
  • DeleteFacetConfigV2 - Delete a facet configuration

New Searchabilities V2 Methods

  • RetrieveSearchabilitiesV2 - Retrieve searchabilities with filtering/pagination
  • GetSearchabilityV2 - Get a specific searchability by name
  • PatchSearchabilitiesV2 - Batch create or update searchabilities
  • PatchSearchabilityV2 - Update a single searchability
  • DeleteSearchabilitiesV2 - Batch delete searchabilities
  • DeleteSearchabilityV2 - Delete a single searchability

New Models

  • FacetV2 - V2 facet model with new fields (Countable, OptionsLimit, Hierarchical type, CreatedAt, UpdatedAt)
  • FacetTypeV2 - Enum adding Hierarchical type
  • FacetV2GetAllResponse - Response wrapper for listing facets
  • SearchabilityV2 - V2 searchability model with new fields (Displayable, Hidden, CreatedAt, UpdatedAt)
  • SearchabilitiesV2Response - Response wrapper for searchabilities operations
  • RetrieveSearchabilitiesV2Request - Request object with filtering/sorting options
  • PatchSearchabilitiesV2Request - Request object for batch create/update
  • DeleteSearchabilitiesV2Request - Request object for batch delete

V2 API Differences from V1

Facets:

  • New Hierarchical facet type
  • New Countable field (skip counting for high-cardinality facets)
  • New OptionsLimit field (limit options returned in search)
  • New CreatedAt/UpdatedAt timestamps
  • Uses path_in_metadata instead of inferring from name

Searchabilities:

  • Removes percentage_presence, example_items, and type fields
  • Adds Displayable and Hidden fields
  • Adds CreatedAt/UpdatedAt timestamps
  • Simplified query parameter filtering (direct boolean params vs nested filters)

Test Plan

  • Added FacetTestsV2.cs with 15 test cases covering all facet operations
  • Added SearchabilityTestsV2.cs with 12 test cases covering all searchability operations
  • All tests include proper cleanup in OneTimeTearDown
  • Solution builds successfully

Breaking Changes

None. V2 methods are additive and V1 methods remain unchanged.

@aandrukhovich aandrukhovich changed the title cio-netcore changes Add V2 Facets and Searchabilities API Support Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants