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

fix scalar index creation #275

Merged
merged 1 commit into from
Sep 20, 2023
Merged
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
18 changes: 17 additions & 1 deletion client/src/consts/Milvus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ export const MILVUS_URL =

export const DYNAMIC_FIELD = `$meta`;

export enum INDEX_TYPES_ENUM {
AUTO_INDEX = 'AUTO_INDEX',
IVF_FLAT = 'IVF_FLAT',
IVF_PQ = 'IVF_PQ',
IVF_SQ8 = 'IVF_SQ8',
IVF_SQ8_HYBRID = 'IVF_SQ8_HYBRID',
FLAT = 'FLAT',
HNSW = 'HNSW',
ANNOY = 'ANNOY',
RNSG = 'RNSG',
BIN_IVF_FLAT = 'BIN_IVF_FLAT',
BIN_FLAT = 'BIN_FLAT',
SORT = 'STL_SORT',
MARISA_TRIE = 'Trie',
}

export enum METRIC_TYPES_VALUES {
L2 = 'L2',
IP = 'IP',
Expand Down Expand Up @@ -158,7 +174,7 @@ export const INDEX_OPTIONS_MAP = {
[DataTypeEnum.VarChar]: [
{
label: 'marisa-trie',
value: 'marisa-trie',
value: INDEX_TYPES_ENUM.MARISA_TRIE
},
],
};
Expand Down
5 changes: 3 additions & 2 deletions client/src/pages/schema/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
INDEX_CONFIG,
INDEX_OPTIONS_MAP,
METRIC_TYPES_VALUES,
INDEX_TYPES_ENUM,
} from '@/consts';
import { useFormValidation } from '@/hooks';
import { getCreateIndexJSCode } from '@/utils/code/Js';
Expand All @@ -23,7 +24,7 @@ import {
import { DataTypeEnum, DataTypeStringEnum } from '../collections/Types';
import CreateForm from './CreateForm';
import SizingInfo from './SizingInfo';
import { IndexType, IndexExtraParam, INDEX_TYPES_ENUM } from './Types';
import { IndexType, IndexExtraParam } from './Types';

const CreateIndex = (props: {
collectionName: string;
Expand Down Expand Up @@ -140,7 +141,7 @@ const CreateIndex = (props: {
return INDEX_OPTIONS_MAP[DataTypeEnum.VarChar];

default:
return [{ label: 'Ascending', value: 'sort' }];
return [{ label: 'STL sort', value: INDEX_TYPES_ENUM.SORT }];
}
}, [fieldType]);

Expand Down
18 changes: 1 addition & 17 deletions client/src/pages/schema/Types.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
import { ReactElement } from 'react';
import { MetricType } from '@/consts';
import { MetricType, INDEX_TYPES_ENUM } from '@/consts';
import { DataTypeStringEnum } from '../collections/Types';

export enum INDEX_TYPES_ENUM {
AUTO_INDEX = 'AUTO_INDEX',
IVF_FLAT = 'IVF_FLAT',
IVF_PQ = 'IVF_PQ',
IVF_SQ8 = 'IVF_SQ8',
IVF_SQ8_HYBRID = 'IVF_SQ8_HYBRID',
FLAT = 'FLAT',
HNSW = 'HNSW',
ANNOY = 'ANNOY',
RNSG = 'RNSG',
BIN_IVF_FLAT = 'BIN_IVF_FLAT',
BIN_FLAT = 'BIN_FLAT',
SORT = 'sort',
MARISA_TRIE = 'marisa-trie',
}

export interface Field {
data_type: DataTypeStringEnum;
fieldID: string;
Expand Down
3 changes: 2 additions & 1 deletion client/src/utils/SizingTool.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { INDEX_TYPES_ENUM, SIZE_STATUS } from '../pages/schema/Types';
import { SIZE_STATUS } from '../pages/schema/Types';
import { INDEX_TYPES_ENUM } from '@/consts';

const commonValueCalculator = (
vector: number,
Expand Down
8 changes: 2 additions & 6 deletions client/src/utils/search.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { Field } from '../components/advancedSearch/Types';
import { DataTypeEnum, DataTypeStringEnum } from '../pages/collections/Types';
import {
FieldData,
IndexType,
IndexView,
INDEX_TYPES_ENUM,
} from '../pages/schema/Types';
import { FieldData, IndexType, IndexView } from '../pages/schema/Types';
import { INDEX_TYPES_ENUM } from '@/consts';
import { FieldOption } from '../types/SearchTypes';

/**
Expand Down
Loading