Giter Site home page Giter Site logo

Comments (3)

tomatolog avatar tomatolog commented on June 24, 2024

could you provide the stream of the create table or alter table statements that recreates the issue here locally?

from manticoresearch.

chiacy avatar chiacy commented on June 24, 2024

hi!

create table

create TABLE rt10 (
id bigint,
title string attribute,
alias text,
shortlink text,
video_url text,
audio text,
edited string attribute,
img string,
caption text,
slider text,
summary text,
points text,
content text,
keywords string attribute,
status integer,
audioflag integer,
created timestamp,
updated timestamp,
type string attribute,
language string attribute,
pcategory string attribute,
category string attribute,
options string attribute,
flash string attribute,
tags string attribute,
author string attribute,
source string attribute,
vector float_vector knn_type='hnsw' knn_dims='1024' hnsw_similarity='cosine'
) html_strip='1' charset_table='non_cjk, U+3400..U+4DBF, U+4E00..U+9FFF, U+20000..U+2A6DF, U+2A700..U+2B73F, U+2B740..U+2B81F, U+2B820..U+2CEAF, U+F900..U+FAFF, U+2F800..U+2FA1F' blend_chars='-, +, &->+' morphology='stem_en, icu_chinese' wordform='/etc/manticoresearch/masterWordForm.txt';

then subsequently

alter table rt10 add column vector_zh float_vector knn_type='hnsw' knn_dims='768' hnsw_similarity='cosine';

then result of show create table rt10

CREATE TABLE rt10 (
id bigint,
alias text,
shortlink text,
video_url text,
audio text,
caption text,
slider text,
summary text,
points text,
content text,
title string attribute,
edited string attribute,
img string attribute,
keywords string attribute,
status integer,
audioflag integer,
created timestamp,
updated timestamp,
type string attribute,
language string attribute,
pcategory string attribute,
category string attribute,
options string attribute,
flash string attribute,
tags string attribute,
author string attribute,
source string attribute,
vector float_vector knn_type='hnsw' knn_dims='1024' hnsw_similarity='COSINE',
vector_zh float_vector knn_type='hnsw' knn_dims='0' hnsw_similarity='L2'
) html_strip='1' charset_table='non_cjk, U+3400..U+4DBF, U+4E00..U+9FFF, U+20000..U+2A6DF, U+2A700..U+2B73F, U+2B740..U+2B81F, U+2B820..U+2CEAF, U+F900..U+FAFF, U+2F800..U+2FA1F' blend_chars='-, +, &->+' morphology='stem_en, icu_chinese'

if I create the index directly with 2 vector columns of different dimensions:

create TABLE rt20 (
id bigint,
title string attribute,
alias text,
shortlink text,
video_url text,
audio text,
edited string attribute,
img string,
caption text,
slider text,
summary text,
points text,
content text,
keywords string attribute,
status integer,
audioflag integer,
created timestamp,
updated timestamp,
type string attribute,
language string attribute,
pcategory string attribute,
category string attribute,
options string attribute,
flash string attribute,
tags string attribute,
author string attribute,
source string attribute,
vector float_vector knn_type='hnsw' knn_dims='1024' hnsw_similarity='cosine',
vector_zh float_vector knn_type='hnsw' knn_dims='768' hnsw_similarity='cosine'
) html_strip='1' charset_table='non_cjk, U+3400..U+4DBF, U+4E00..U+9FFF, U+20000..U+2A6DF, U+2A700..U+2B73F, U+2B740..U+2B81F, U+2B820..U+2CEAF, U+F900..U+FAFF, U+2F800..U+2FA1F' blend_chars='-, +, &->+' morphology='stem_en, icu_chinese' wordform='/etc/manticoresearch/masterWordForm.txt';

it then shows correctly when show create table rt20

CREATE TABLE rt20 (
id bigint,
alias text,
shortlink text,
video_url text,
audio text,
caption text,
slider text,
summary text,
points text,
content text,
title string attribute,
edited string attribute,
img string attribute,
keywords string attribute,
status integer,
audioflag integer,
created timestamp,
updated timestamp,
type string attribute,
language string attribute,
pcategory string attribute,
category string attribute,
options string attribute,
flash string attribute,
tags string attribute,
author string attribute,
source string attribute,
vector float_vector knn_type='hnsw' knn_dims='1024' hnsw_similarity='COSINE',
vector_zh float_vector knn_type='hnsw' knn_dims='768' hnsw_similarity='COSINE'
) html_strip='1' charset_table='non_cjk, U+3400..U+4DBF, U+4E00..U+9FFF, U+20000..U+2A6DF, U+2A700..U+2B73F, U+2B740..U+2B81F, U+2B820..U+2CEAF, U+F900..U+FAFF, U+2F800..U+2FA1F' blend_chars='-, +, &->+' morphology='stem_en, icu_chinese'

is this what you need?

from manticoresearch.

sanikolaev avatar sanikolaev commented on June 24, 2024

MRE

mysql> drop table if exists t; create table t ( f1 float_vector knn_type='hnsw' knn_dims='2' hnsw_similarity='l2' ); alter table t add column f2 float_vector knn_type='hnsw' knn_dims='3' hnsw_similarity='l2'; show create table t\G
--------------
drop table if exists t
--------------

Query OK, 0 rows affected (0.01 sec)

--------------
create table t ( f1 float_vector knn_type='hnsw' knn_dims='2' hnsw_similarity='l2' )
--------------

Query OK, 0 rows affected (0.01 sec)

--------------
alter table t add column f2 float_vector knn_type='hnsw' knn_dims='3' hnsw_similarity='l2'
--------------

Query OK, 0 rows affected (0.00 sec)

--------------
show create table t
--------------

*************************** 1. row ***************************
       Table: t
Create Table: CREATE TABLE t (
id bigint,
f1 float_vector knn_type='hnsw' knn_dims='2' hnsw_similarity='L2',
f2 float_vector knn_type='hnsw' knn_dims='0' hnsw_similarity='L2'
)
1 row in set (0.00 sec)

Expected non-zero dimensions:

Create Table: CREATE TABLE t (
id bigint,
f1 float_vector knn_type='hnsw' knn_dims='2' hnsw_similarity='L2',
f2 float_vector knn_type='hnsw' knn_dims='3' hnsw_similarity='L2'
)

from manticoresearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.