Add V2 Facets and Searchabilities API Support #88
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add V2 Facets and Searchabilities API Support
Summary
This PR adds support for the V2 versions of the
/v2/facetsand/v2/searchabilitiesendpoints, running in parallel with the existing V1 implementations.Changes
New Facets V2 Methods
CreateFacetConfigV2- Create a single facet configurationGetAllFacetConfigsV2- Retrieve all facet configurations with paginationGetFacetConfigV2- Get a specific facet by nameCreateOrReplaceFacetConfigsV2- Batch create or replace facets (PUT)BatchPartiallyUpdateFacetConfigsV2- Batch partial update facets (PATCH)ReplaceFacetConfigV2- Replace a single facet configurationPartiallyUpdateFacetConfigV2- Partially update a single facetDeleteFacetConfigV2- Delete a facet configurationNew Searchabilities V2 Methods
RetrieveSearchabilitiesV2- Retrieve searchabilities with filtering/paginationGetSearchabilityV2- Get a specific searchability by namePatchSearchabilitiesV2- Batch create or update searchabilitiesPatchSearchabilityV2- Update a single searchabilityDeleteSearchabilitiesV2- Batch delete searchabilitiesDeleteSearchabilityV2- Delete a single searchabilityNew Models
FacetV2- V2 facet model with new fields (Countable,OptionsLimit,Hierarchicaltype,CreatedAt,UpdatedAt)FacetTypeV2- Enum addingHierarchicaltypeFacetV2GetAllResponse- Response wrapper for listing facetsSearchabilityV2- V2 searchability model with new fields (Displayable,Hidden,CreatedAt,UpdatedAt)SearchabilitiesV2Response- Response wrapper for searchabilities operationsRetrieveSearchabilitiesV2Request- Request object with filtering/sorting optionsPatchSearchabilitiesV2Request- Request object for batch create/updateDeleteSearchabilitiesV2Request- Request object for batch deleteV2 API Differences from V1
Facets:
Hierarchicalfacet typeCountablefield (skip counting for high-cardinality facets)OptionsLimitfield (limit options returned in search)CreatedAt/UpdatedAttimestampspath_in_metadatainstead of inferring from nameSearchabilities:
percentage_presence,example_items, andtypefieldsDisplayableandHiddenfieldsCreatedAt/UpdatedAttimestampsTest Plan
FacetTestsV2.cswith 15 test cases covering all facet operationsSearchabilityTestsV2.cswith 12 test cases covering all searchability operationsOneTimeTearDownBreaking Changes
None. V2 methods are additive and V1 methods remain unchanged.