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

Add support for new Weaviate v1.26 features in TSv2 #164

Open
wants to merge 5 commits into
base: stable/v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:


env:
WEAVIATE_VERSION: 1.25.1
WEAVIATE_VERSION: preview-merge-stable-v1-26-into-main-5593f06

jobs:
checks:
Expand Down
13 changes: 10 additions & 3 deletions src/openapi/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ export interface definitions {
ReplicationConfig: {
/** @description Number of times a class is replicated */
factor?: number;
/** @description Enable asynchronous replication */
asyncEnabled?: boolean;
};
/** @description tuning parameters for the BM25 algorithm */
BM25Config: {
Expand Down Expand Up @@ -371,6 +373,8 @@ export interface definitions {
enabled?: boolean;
/** @description Nonexistent tenants should (not) be created implicitly */
autoTenantCreation?: boolean;
/** @description Existing tenants should (not) be turned HOT implicitly when they are accessed and in another activity status */
autoTenantActivation?: boolean;
};
/** @description JSON object value. */
JsonObject: { [key: string]: unknown };
Expand Down Expand Up @@ -508,11 +512,13 @@ export interface definitions {
indexFilterable?: boolean;
/** @description Optional. Should this property be indexed in the inverted index. Defaults to true. Applicable only to properties of data type text and text[]. If you choose false, you will not be able to use this property in bm25 or hybrid search. This property has no affect on vectorization decisions done by modules */
indexSearchable?: boolean;
/** @description Optional. Should this property be indexed in the inverted index. Defaults to false. Provides better performance for range queries compared to filterable index in large datasets. Applicable only to properties of data type int, number, date. */
indexRangeFilters?: boolean;
/**
* @description Determines tokenization of the property as separate words or whole field. Optional. Applies to text and text[] data types. Allowed values are `word` (default; splits on any non-alphanumerical, lowercases), `lowercase` (splits on white spaces, lowercases), `whitespace` (splits on white spaces), `field` (trims). Not supported for remaining data types
* @enum {string}
*/
tokenization?: 'word' | 'lowercase' | 'whitespace' | 'field' | 'trigram' | 'gse';
tokenization?: 'word' | 'lowercase' | 'whitespace' | 'field' | 'trigram' | 'gse' | 'kagome_kr';
/** @description The properties of the nested object(s). Applies to object and object[] data types. */
nestedProperties?: definitions['NestedProperty'][];
};
Expand All @@ -530,6 +536,7 @@ export interface definitions {
name?: string;
indexFilterable?: boolean;
indexSearchable?: boolean;
indexRangeFilters?: boolean;
/** @enum {string} */
tokenization?: 'word' | 'lowercase' | 'whitespace' | 'field';
nestedProperties?: definitions['NestedProperty'][];
Expand Down Expand Up @@ -1282,10 +1289,10 @@ export interface definitions {
/** @description name of the tenant */
name?: string;
/**
* @description activity status of the tenant's shard. Optional for creating tenant (implicit `HOT`) and required for updating tenant. Allowed values are `HOT` - tenant is fully active, `WARM` - tenant is active, some restrictions are imposed (TBD; not supported yet), `COLD` - tenant is inactive; no actions can be performed on tenant, tenant's files are stored locally, `FROZEN` - as COLD, but files are stored on cloud storage (not supported yet)
* @description activity status of the tenant's shard. Optional for creating tenant (implicit `HOT`) and required for updating tenant. For creation, allowed values are `HOT` - tenant is fully active and `COLD` - tenant is inactive; no actions can be performed on tenant, tenant's files are stored locally. For updating, `HOT`, `COLD` and also `FROZEN` - as COLD, but files are stored on cloud storage. The following values are read-only and are set by the server for internal use: `FREEZING` - tenant is transitioning from HOT/COLD to FROZEN, `UNFREEZING` - tenant is transitioning from FROZEN to HOT/COLD
* @enum {string}
*/
activityStatus?: 'HOT' | 'WARM' | 'COLD' | 'FROZEN';
activityStatus?: 'HOT' | 'COLD' | 'FROZEN' | 'FREEZING' | 'UNFREEZING';
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/openapi/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export type WhereFilter = definitions['WhereFilter'];
// Schema
export type WeaviateSchema = definitions['Schema'];
export type WeaviateClass = definitions['Class'];
export type Tenant = definitions['Tenant'];
export type ShardStatus = definitions['ShardStatus'];
export type ShardStatusList = definitions['ShardStatusList'];
export type Tenant = definitions['Tenant'];
export type SchemaClusterStatus = definitions['SchemaClusterStatus'];
// Nodes
export type NodesStatusResponse = definitions['NodesStatusResponse'];
21 changes: 20 additions & 1 deletion src/schema/journey.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ describe('schema', () => {
name: 'anotherProp',
tokenization: 'field',
indexFilterable: true,
indexRangeFilters: false,
indexSearchable: true,
moduleConfig: {
'text2vec-contextionary': {
Expand Down Expand Up @@ -112,6 +113,7 @@ describe('schema', () => {
name: 'stringProp',
tokenization: 'word',
indexFilterable: true,
indexRangeFilters: false,
indexSearchable: true,
moduleConfig: {
'text2vec-contextionary': {
Expand All @@ -125,6 +127,7 @@ describe('schema', () => {
name: 'anotherProp',
tokenization: 'field',
indexFilterable: true,
indexRangeFilters: false,
indexSearchable: true,
moduleConfig: {
'text2vec-contextionary': {
Expand Down Expand Up @@ -158,6 +161,11 @@ describe('schema', () => {
bq: {
enabled: false,
},
sq: {
enabled: false,
rescoreLimit: 20,
trainingLimit: 100000,
},
skip: false,
efConstruction: 128,
vectorCacheMaxObjects: 500000,
Expand All @@ -181,6 +189,7 @@ describe('schema', () => {
},
},
multiTenancyConfig: {
autoTenantActivation: false,
autoTenantCreation: false,
enabled: false,
},
Expand All @@ -195,6 +204,7 @@ describe('schema', () => {
virtualPerPhysical: 128,
},
replicationConfig: {
asyncEnabled: true,
factor: 1,
},
},
Expand Down Expand Up @@ -587,7 +597,7 @@ describe('property setting defaults and migrations', () => {
);

const errMsg1 =
'`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`';
'`indexInverted` is deprecated and can not be set together with `indexFilterable`, `indexSearchable` or `indexRangeFilters`';
const errMsg2 = '`indexSearchable` is allowed only for text/text[] data types';
test.each([
['text', false, null, false, errMsg1],
Expand Down Expand Up @@ -679,6 +689,7 @@ describe('multi tenancy', () => {
vectorIndexType: 'hnsw',
vectorizer: 'text2vec-contextionary',
multiTenancyConfig: {
autoTenantActivation: true,
autoTenantCreation: true,
enabled: true,
},
Expand Down Expand Up @@ -786,6 +797,7 @@ function newClassObject(className: string) {
name: 'stringProp',
tokenization: 'word',
indexFilterable: true,
indexRangeFilters: false,
indexSearchable: true,
moduleConfig: {
'text2vec-contextionary': {
Expand Down Expand Up @@ -819,6 +831,11 @@ function newClassObject(className: string) {
bq: {
enabled: false,
},
sq: {
enabled: false,
rescoreLimit: 20,
trainingLimit: 100000,
},
skip: false,
efConstruction: 128,
vectorCacheMaxObjects: 500000,
Expand All @@ -842,6 +859,7 @@ function newClassObject(className: string) {
},
},
multiTenancyConfig: {
autoTenantActivation: false,
autoTenantCreation: false,
enabled: false,
},
Expand All @@ -856,6 +874,7 @@ function newClassObject(className: string) {
virtualPerPhysical: 128,
},
replicationConfig: {
asyncEnabled: true,
factor: 1,
},
};
Expand Down
4 changes: 1 addition & 3 deletions src/schema/tenantsCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@ export default class TenantsCreator extends CommandBase {
// nothing to validate
};

do = (): Promise<Array<Tenant>> => {
return this.client.post(`/schema/${this.className}/tenants`, this.tenants);
};
do = (): Promise<Array<Tenant>> => this.client.post(`/schema/${this.className}/tenants`, this.tenants);
}
4 changes: 1 addition & 3 deletions src/schema/tenantsGetter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@ export default class TenantsGetter extends CommandBase {
// nothing to validate
};

do = (): Promise<Array<Tenant>> => {
return this.client.get(`/schema/${this.className}/tenants`);
};
do = (): Promise<Array<Tenant>> => this.client.get(`/schema/${this.className}/tenants`);
}
4 changes: 1 addition & 3 deletions src/schema/tenantsUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@ export default class TenantsUpdater extends CommandBase {
// nothing to validate
};

do = (): Promise<Array<Tenant>> => {
return this.client.put(`/schema/${this.className}/tenants`, this.tenants);
};
do = (): Promise<Array<Tenant>> => this.client.put(`/schema/${this.className}/tenants`, this.tenants);
}
Loading