Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: add support for overrides / curation #32

Merged
merged 12 commits into from
Aug 2, 2024

Conversation

phiHero
Copy link
Contributor

@phiHero phiHero commented Aug 1, 2024

Change Summary

Create or update an override

let schema = SearchOverrideSchema<MetadataType>(
    rule: SearchOverrideRule(tags: ["test"], query: "apple", match: SearchOverrideRule.Match.exact, filterBy: "employees:=50"),
    includes: [SearchOverrideInclude(_id: "include-id", position: 1)],
    excludes: [SearchOverrideExclude(_id: "exclude-id")],
    filterBy: "test:=true",
    removeMatchedTokens: false,
    metadata: MetadataType(message: "test-json"),
    sortBy: "num_employees:desc",
    replaceQuery: "test",
    filterCuratedHits: false,
    effectiveFromTs: 123,
    effectiveToTs: 456,
    stopProcessing: false
)
let (data, response) = try await client.collection(name: "books").overrides().upsert(overrideId: "test-id", params: schema)

Retrieve all overrides

let (data, response) = try await client.collection(name: "books").overrides().retrieve(metadataType: Never.self )

Retrieve an override

let (data, response) = try await client.collection(name: "books").override("test-id").retrieve(metadataType: MetadataType.self )

Delete an override

let (data, response) = try await client.collection(name: "books").override("test-id").delete()

PR Checklist

@jasonbosco jasonbosco merged commit ac11f7a into typesense:master Aug 2, 2024
1 check passed
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