向量检索

更新时间:
复制 MD 格式

Lindorm支持通过搜索索引使用向量检索功能,本文介绍如何通过搜索索引及SQL方式完成向量检索。

前提条件

准备数据

通过MySQL命令行连接并使用宽表引擎,准备SQL表并写入样例数据。

连接宽表引擎创建SQL表

以下示例中,embedding列用于写入向量数据,向量列定义为 VECTOR(n) 类型。

CREATE TABLE product_items (
  id VARCHAR,
  title VARCHAR,
  content VARCHAR,
  category VARCHAR,
  status VARCHAR,
  price DOUBLE,
  embedding VECTOR(8),
  PRIMARY KEY (id)
);

写入样例数据

向量列embedding写入的格式应为'[...]',由方括号包围的浮点数数组。以下示例写入10条数据,创建索引时使用下文HNSWQ的示例,可以触发离线索引训练。

UPSERT INTO product_items (id, title, content, category, status, price, embedding)
VALUES (
  'item_001',
  '主动降噪蓝牙耳机',
  '无线蓝牙耳机,支持主动降噪、通透模式和长续航,适合通勤和运动使用',
  'audio',
  'ON_SALE',
  399.00,
  '[0.067985594, 0.94134957, 0.9174301, 0.34755236, 0.3318444, 0.30996937, 0.12764448, 0.9909833]'
);

UPSERT INTO product_items (id, title, content, category, status, price, embedding)
VALUES (
  'item_002',
  '轻薄办公笔记本',
  '14英寸轻薄本,适合移动办公、文档编辑和在线会议',
  'computer',
  'ON_SALE',
  5299.00,
  '[0.48320667, 0.12729345, 0.86240918, 0.57118409, 0.09480932, 0.69527483, 0.31873674, 0.23437815]'
);

UPSERT INTO product_items (id, title, content, category, status, price, embedding)
VALUES (
  'item_003',
  '真无线运动耳机',
  '入耳式运动耳机,防水防汗,佩戴稳固,适合跑步、健身和户外训练',
  'audio',
  'ON_SALE',
  299.00,
  '[0.08234191, 0.88452947, 0.90317422, 0.39284715, 0.28741066, 0.34491053, 0.16588271, 0.94621736]'
);

UPSERT INTO product_items (id, title, content, category, status, price, embedding)
VALUES (
  'item_004',
  '机械键盘',
  '87键蓝牙双模机械键盘,茶轴手感,适合程序员和文字办公',
  'computer',
  'ON_SALE',
  269.00,
  '[0.51690823, 0.18346277, 0.80153459, 0.62274118, 0.14639502, 0.73124588, 0.37261894, 0.28194763]'
);

UPSERT INTO product_items (id, title, content, category, status, price, embedding)
VALUES (
  'item_005',
  '4K办公显示器',
  '27英寸4K高清显示器,支持Type-C连接,适合编程、设计和多窗口办公',
  'computer',
  'ON_SALE',
  1599.00,
  '[0.54781264, 0.10893452, 0.83476129, 0.68420137, 0.17266381, 0.76249855, 0.40122976, 0.31508492]'
);

UPSERT INTO product_items (id, title, content, category, status, price, embedding)
VALUES (
  'item_006',
  '空气炸锅',
  '大容量无油空气炸锅,支持薯条、鸡翅和蛋挞等多种烹饪模式',
  'home',
  'ON_SALE',
  329.00,
  '[0.73492115, 0.29481763, 0.21837490, 0.81246537, 0.69021458, 0.14763829, 0.52390741, 0.40831672]'
);

UPSERT INTO product_items (id, title, content, category, status, price, embedding)
VALUES (
  'item_007',
  '扫地机器人',
  '智能扫地机器人,支持激光导航、自动集尘和拖地,适合家庭地面清洁',
  'home',
  'ON_SALE',
  1699.00,
  '[0.78261493, 0.25173984, 0.19652837, 0.84501926, 0.72148305, 0.11947682, 0.56821344, 0.45290631]'
);

UPSERT INTO product_items (id, title, content, category, status, price, embedding)
VALUES (
  'item_008',
  '户外冲锋衣',
  '防风防水透气面料,适合徒步、露营和日常通勤穿着',
  'outdoor',
  'ON_SALE',
  599.00,
  '[0.21469385, 0.67248120, 0.35890274, 0.18673549, 0.82401652, 0.53371908, 0.74258136, 0.29467011]'
);

UPSERT INTO product_items (id, title, content, category, status, price, embedding)
VALUES (
  'item_009',
  '露营帐篷',
  '双层防雨露营帐篷,空间宽敞,适合家庭露营和周末户外活动',
  'outdoor',
  'ON_SALE',
  499.00,
  '[0.23687049, 0.70452813, 0.33147592, 0.15829476, 0.85739241, 0.50468327, 0.79124658, 0.26391844]'
);

UPSERT INTO product_items (id, title, content, category, status, price, embedding)
VALUES (
  'item_010',
  '儿童保温杯',
  '316不锈钢儿童保温杯,带吸管和防漏杯盖,适合学生日常饮水',
  'baby',
  'ON_SALE',
  89.00,
  '[0.39128467, 0.41873925, 0.64208193, 0.24759318, 0.50371684, 0.28645079, 0.19582734, 0.86140952]'
);

创建搜索索引

通过MySQL命令行连接并使用宽表引擎,创建包含向量列的搜索索引。

向量列在索引中通过mapping指定具体的向量索引算法、距离算法和其他算法参数,以下提供HNSWQ和IVFBQ的索引创建示例,更多详细配置可参考通过 curl 命令连接并使用向量引擎。

说明
  • 属性下推,如果有标量参与向量检索,可以对标量列设置属性下推提升检索性能,下推会占用向量内存资源,需要业务评估检索字段。详细说明见 标量属性下推:加速向量+标量查询混合检索。

  • 属性下推必须使用efficient_filter,并且必须要在发起索引训练完成后才可以。

HNSWQ 示例

CREATE INDEX product_vector_idx USING SEARCH ON product_items (
  id,
  title,
  content(type=text, analyzer=ik),
  category(mapping='{"type": "keyword", "meta": {"_vector_filter": "true"}}'),
  status(mapping='{"type": "keyword", "meta": {"_vector_filter": "true"}}'),
  price(mapping='{"type": "double", "meta": {"_vector_filter": "true"}}'),
  embedding(mapping='{
    "type":"knn_vector",
    "dimension":8,
    "data_type":"float",
    "meta":{
      "offline.construction":"true"
    },
    "method":{
      "name":"hnswq",
      "engine":"lvector",
      "space_type":"l2",
      "parameters":{
        "m":32,
        "ef_construction":400
      }
    }
  }')
) WITH (
  INDEX_SETTINGS='{
    "index.knn.vector_empty_value_to_keep": true
  }'
);
  • hnswq写入发起训练数据量要严格大于数据维度,灌入现有离线数据后发起一次训练即可。

  • 属性下推按需设置

IVFBQ 索引示例

IVFBQ 需要先写入足够的训练数据,再触发向量离线训练。

CREATE INDEX product_vector_idx USING SEARCH ON product_items (
  id,
  title,
  content(type=text, analyzer=ik),
  category(mapping='{"type": "keyword", "meta": {"_vector_filter": "true"}}'),
  status(mapping='{"type": "keyword", "meta": {"_vector_filter": "true"}}'),
  price(mapping='{"type": "double", "meta": {"_vector_filter": "true"}}'),
  embedding(mapping='{
    "type":"knn_vector",
    "dimension":8,
    "data_type":"float",
    "meta":{
      "offline.construction":"true"
    },
    "method":{
      "name":"ivfbq",
      "engine":"lvector",
      "space_type":"l2",
      "parameters":{
        "exbits":2,
        "nlist":10000
      }
    }
  }')
) WITH (
  INDEX_SETTINGS='{
    "index.knn.vector_empty_value_to_keep": true
  }'
);
  • 发起 IVFBQ 训练前,向量数据量必须大于 256 条,并且超过 nlist 的 30 倍。建议完成离线数据导入后再触发训练。

  • 属性下推按需设置

为已有搜索索引添加向量列

索引支持后添加向量列,方式和普通索引加列方式一致,可参考新增搜索索引列。新加的列如果有历史数据,需要执行rebuild操作,把历史数据同步到索引中。

以下是增加向量列的示例。

ALTER TABLE product_items
ADD COLUMN image_vector VECTOR(8);

ALTER INDEX product_vector_idx ON product_items
ADD COLUMNS (
  image_vector(mapping='{
    "type":"knn_vector",
    "dimension":8,
    "data_type":"float",
    "meta":{
      "offline.construction":"true"
    },
    "method":{
      "name":"hnswq",
      "engine":"lvector",
      "space_type":"l2",
      "parameters":{
        "m":32,
        "ef_construction":400
      }
    }
  }')
);

离线训练向量索引

采用异步方式发起训练

ALTER INDEX product_vector_idx ON product_items
REBUILD VECTOR INDEX ON embedding
WITH (REMOVE_OLD_INDEX=true);
  • (默认)REMOVE_OLD_INDEX=true:删除旧向量索引后重新训练。训练完成前,该向量列无法提供 KNN 查询;推荐使用该模式。

  • REMOVE_OLD_INDEX=false:训练期间保留旧向量索引,但旧索引会继续占用资源,并可能影响查询性能,建议使用true

查看进度

SHOW INDEX FROM product_items;

通过结果中的 INDEX_VECTOR_BUILD_INFO 查看每个向量列的训练状态。只有状态为 FINISH 才表示训练成功;FAIL 和 ABORT 也属于任务终态,但不表示成功。

终止训练

ALTER INDEX product_vector_idx ON product_items
ABORT REBUILD VECTOR INDEX ON embedding;

同一张表、同一个搜索索引、同一个向量列同一时间只能存在一个训练任务。

查询数据

向量检索支持通过 MySQL 和 OLAP资源组两种方式完成,参考以下示例。

通过MySQL协议执行向量检索

MySQL协议中通过 vector_distance 指定搜索索引向量检索。实际的距离算法以索引 mapping 中定义的 space_type 为准。

纯向量检索

SELECT
  id,
  title,
  category,
  price,
  l_search_score() as score
FROM product_items
ORDER BY vector_distance(
  embedding,
  '[0.067985594, 0.94134957, 0.9174301, 0.34755236, 0.3318444, 0.30996937, 0.12764448, 0.9909833]'
)
LIMIT 10;

向量检索 + 标量过滤

SELECT /*+ _l_force_vector_index_(lvector.filter_type=efficient_filter) */
  id,
  title,
  category,
  price,
  l_search_score() as score
FROM product_items
WHERE status = 'ON_SALE'
  AND category = 'audio'
ORDER BY vector_distance(embedding, '[0.067985594,0.94134957,0.9174301,0.34755236,0.3318444,0.30996937,0.12764448,0.9909833]')
LIMIT 20;
  • _l_force_vector_index_(lvector.filter_type=efficient_filter)用于指定标量过滤的模式。指定为efficient_filter时,服务端会根据标量条件的选择率,选择最优过滤模式。

双路召回

“双路召回”指一次查询中同时使用向量检索和全文检索两条召回链路:向量检索根据 query vector 召回语义相近的数据,全文检索根据关键词/分词匹配召回文本相关的数据。开启 RRF 融合后,系统会分别对两路召回结果进行排序,再基于 RRF 策略融合排序结果,得到最终返回列表。关于RRF计算方式的进一步详细说明,可以参考:融合查询计算方式

当前指定lvector.hybrid_search_type=filter_rrf时,默认会将查询中的全文检索条件作为rrf的全文检索一路。

SELECT /*+ _l_force_vector_index_(
           lvector.hybrid_search_type=filter_rrf
       ) */
       id,
       title,
       content,
       price,
       l_search_score() as score
FROM product_items
WHERE match(content) against('无线蓝牙耳机 降噪')
  AND status = 'ON_SALE'
ORDER BY vector_distance(
           embedding,
           '[0.12,0.08,0.35,0.44,0.19,0.27,0.03,0.91]'
         )
LIMIT 20;

通过OLAP资源组执行向量检索

通过 OLAP 资源组查询宽表数据时,使用 _l_force_vector_index_ 强制选择基础特性中的向量索引。OLAP 资源组的 SQL 使用与距离类型对应的函数:l2_distance、cosine_similarity 或 innerproduct_distance。

纯向量检索

SELECT /*+ _l_force_vector_index_ */
  id,
  title,
  category,
  price,
  _vector_score_(
    embedding,
    '[0.067985594, 0.94134957, 0.9174301, 0.34755236, 0.3318444, 0.30996937, 0.12764448, 0.9909833]'
  ) AS vector_score
FROM product_items
ORDER BY l2_distance(
  embedding,
  '[0.067985594, 0.94134957, 0.9174301, 0.34755236, 0.3318444, 0.30996937, 0.12764448, 0.9909833]'
)
LIMIT 10;

向量检索+标量过滤

SELECT /*+ _l_force_vector_index_(lvector.filter_type=efficient_filter) */
  id,
  title,
  category,
  price,
  _vector_score_(
    embedding,
    '[0.067985594, 0.94134957, 0.9174301, 0.34755236, 0.3318444, 0.30996937, 0.12764448, 0.9909833]'
  ) AS vector_score
FROM product_items
WHERE status = 'ON_SALE'
  AND category = 'audio'
ORDER BY l2_distance(
  embedding,
  '[0.067985594, 0.94134957, 0.9174301, 0.34755236, 0.3318444, 0.30996937, 0.12764448, 0.9909833]'
)
LIMIT 20;

双路召回

OLAP资源组通过lindorm_rrf_rank函数指定双路召回查询。

SELECT /*+ _l_force_vector_index_ */
       id,
       title,
       content,
       price,
       _vector_score_(
         embedding,
         '[0.067985594, 0.94134957, 0.9174301, 0.34755236, 0.3318444, 0.30996937, 0.12764448, 0.9909833]'
       ) AS vector_score
FROM product_items
WHERE status = 'ON_SALE'
ORDER BY lindorm_rrf_rank(
           l2_distance(
             embedding,
             '[0.067985594, 0.94134957, 0.9174301, 0.34755236, 0.3318444, 0.30996937, 0.12764448, 0.9909833]'
           ),
           match_against('无线 降噪 耳机', content)
         )
LIMIT 20;

向量检索HINT参数说明

两种接口的向量检索,均支持通过_l_force_vector_index_(...)HINT指定相关查询参数,下面是针对支持参数的说明,更详细的参数可以参考通过 curl 命令连接并使用向量引擎文档中的说明。

参数

默认值

取值

作用

lvector.ef_search

无

1~1000 的整数

HNSW/HNSWQ 查询参数,控制查询阶段候选规模。

lvector.client_refactor

无

true 或 false

是否开启向量查询客户端重构相关逻辑。

lvector.min_score

无

0.0~1.0 的浮点数

向量相似度过滤阈值。

lvector.nprobe

无

正整数

IVF 类算法查询参数,控制查询的聚类中心数量。

lvector.reorder_factor

无

1~200 的整数

查询结果重排参数。

lvector.filter_type

post_filter

pre_filter、post_filter 或 efficient_filter(推荐)

指定向量检索与过滤条件的组合方式。

lvector.hybrid_search_type

无

filter_rrf

开启全文召回与向量召回的 RRF 融合。

lvector.rrf_rank_constant

无

正整数

RRF 排序公式中的 rank constant,默认由底层 RRF 参数处理。

lvector.rrf_window_size

无

正整数

RRF 文本召回窗口大小,未设置时由底层按 topK 处理。

lvector.rrf_knn_weight_factor

无

0.0~1.0 的浮点数

RRF 中向量召回相对全文召回的权重因子。

lvector.cursor_mode

无

stateless、global_sort 或 region_sort

向量游标模式。

写入自动Embedding

如果原始数据是文本、图片等多模态内容,可以通过搜索引擎Pipeline(同步模式)或流引擎ETL(异步模式) 调用 Embedding 模型,将生成的向量写入宽表向量列。

通过搜索引擎Pipeline实现自动Embedding

通过搜索引擎Pipeline可以实现文本、图片的自动Embedding功能。

创建宽表

text-embedding-v4模型默认维度是1024,创建宽表时,向量维度也需要设置成1024。

CREATE TABLE product_items (
  id VARCHAR,
  title VARCHAR,
  content VARCHAR,
  category VARCHAR,
  status VARCHAR,
  price DOUBLE,
  embedding VECTOR(1024),
  PRIMARY KEY (id)
);

配置写入Embedding Pipeline

创建写入Embedding Pipeline,需要通过搜索引擎接口调用,以下提供通过百炼接口调用text-embedding-v4模型实现文本embedding的pipeline样例。示例中的搜索引擎URL、AI引擎URL分别需要替换成实例的搜索引擎地址和AI引擎地址。

curl -u <username>:<password> -H "Content-Type: application/json" -XPUT "http://<搜索引擎URL>/_ingest/pipeline/write-embedding-pipeline" -d '{
  "description": "demo embedding pipeline",
  "processors": [
    {
      "text-embedding": {
        "inputFields": ["content"], 
        "outputFields": ["embedding"],
        "userName": "root",
        "password": "test****",
        "url": "http://<AI引擎URL>/dashscope/compatible-mode/v1/embeddings",
        "modeName": "text-embedding-v4"
      }
    }
  ]
}'

更详细的参数说明参考 自动Embedding的写入与查询方式。

创建搜索索引引用上述pipeline

创建搜索索引需要引用上一步设置的pipeline,数据写入时会实现自动Embedding,注意向量维度需要和embedding后的向量维度对齐,示例中使用1024维。

CREATE INDEX product_vector_idx USING SEARCH ON product_items (
  id,
  title,
  content(type=text, analyzer=ik),
  category(mapping='{"type": "keyword", "meta": {"_vector_filter": "true"}}'),
  status(mapping='{"type": "keyword", "meta": {"_vector_filter": "true"}}'),
  price(mapping='{"type": "double", "meta": {"_vector_filter": "true"}}'),
  embedding(mapping='{
    "type":"knn_vector",
    "dimension":1024,
    "data_type":"float",
    "meta":{
      "offline.construction":"true"
    },
    "method":{
      "name":"hnswq",
      "engine":"lvector",
      "space_type":"l2",
      "parameters":{
        "m":32,
        "ef_construction":200
      }
    }
  }')
) WITH (
  INDEX_SETTINGS='{
    "index.knn.vector_empty_value_to_keep": true,
    "default_pipeline": "write-embedding-pipeline"
  }'
);

写入样例数据

和前述方式不同,写入不需要显式指定向量列数据,只需要写入文本列即可,索引同步会自动完成向量化。

重要

以下只是写入示例,使用HNSWQ索引时,请注意要写入不小于维度数量(1024)的数据,并触发离线训练后,执行查询测试

UPSERT INTO product_items
  (id, title, content, category, status, price)
VALUES
  ('p001', '无线降噪耳机', '支持主动降噪、通透模式和长续航,适合通勤和办公使用', '数码配件', 'ON_SALE', 399.00);

UPSERT INTO product_items
  (id, title, content, category, status, price)
VALUES
  ('p002', '机械键盘', '87 键蓝牙双模机械键盘,茶轴手感,适合程序员和文字办公', '电脑外设', 'ON_SALE', 269.00);

UPSERT INTO product_items
  (id, title, content, category, status, price)
VALUES
  ('p003', '儿童保温杯', '316 不锈钢材质,带吸管和防漏杯盖,适合学生日常使用', '母婴用品', 'ON_SALE', 89.00);

UPSERT INTO product_items
  (id, title, content, category, status, price)
VALUES
  ('p004', '空气炸锅', '大容量无油空气炸锅,支持薯条、鸡翅、蛋挞等多种烹饪模式', '厨房电器', 'ON_SALE', 329.00);

UPSERT INTO product_items
  (id, title, content, category, status, price)
VALUES
  ('p005', '户外冲锋衣', '防风防水透气面料,适合徒步、露营和日常通勤穿着', '运动户外', 'ON_SALE', 599.00);

通过流引擎ETL实现异步向量化

参考文档:异步向量化。

查询自动Embedding

查询目前支持通过宽表的vector_embedding函数完成文本的向量化,用向量化结果执行向量检索。

SELECT vector_embedding(
  'text-embedding-v4',
  '无线降噪耳机,适合通勤和办公',
  1024
) AS query_vector;
SELECT
  id,
  title,
  category,
  price,
  l_search_score() as score
FROM product_items
ORDER BY vector_distance(
  embedding,
  '[0.02459293, -0.018794596, 0.028363274, -0.024921406, 0.10973988, -0.03221931, -0.035561204, 0.00754783, -0.050128445, 0.07352172, 0.05035695, 0.0067623416, 0.042844824, -0.018237613, 0.025821147, -0.05618385, -0.0080405455, -0.0493858, -0.03684655, 5.6099944E-4, 0.018351866, 0.07375023, 0.07295045, -0.032647755, 0.012446421, 0.045415513, 0.05789764, -0.046215285, -0.048157584, 0.0027724172, 0.054013044, -0.060268387, -0.014195919, -0.02734928, -0.029105918, 0.010539827, 0.024035947, 0.04430155, 0.011625229, 0.050642584, -0.023921695, -0.019065946, 0.01936586, -0.0017611008, -0.034590054, -0.002113678, -2.0529811E-4, -0.030591205, -0.0048450357, -0.05238494, 0.03321902, 0.019908562, -0.014345876, -0.016381005, 0.022150775, -0.0028616772, 0.04353034, 0.02930586, 0.001092543, 0.01358895, -0.0014718983, 0.020979682, -0.026606636, -0.050214134, 0.011253907, -0.077120684, -0.0062124995, 0.042130746, -0.011089669, -0.03664661, 0.017537815, 0.023507528, 0.06895161, -0.02282201, 0.004652234, 0.05729781, 0.027449252, 0.05612672, -0.0040988214, 0.033019077, -0.0012237553, -0.091230914, -0.0070586847, -0.03010563, 0.011196781, 0.010275617, -0.02956293, 0.06580965, 0.013246192, 0.08100528, -0.007094389, -0.0024457255, -0.054841377, 0.017694913, -0.021408131, 0.07637804, -0.03516132, 0.050499767, -0.015238476, 0.045158446, -0.005662658, -0.039474364, 0.0030473382, -0.026620917, 0.020137068, 0.006108958, -0.026992239, -0.014417283, -0.010604094, -0.022265028, 0.014795747, -0.030676894, -0.0046058185, 0.026049653, -0.0026063935, -0.013974554, 0.00648385, -0.025335573, -0.025678331, 0.041245285, -0.0024635775, 0.06152517, -0.006191077, -0.03381885, 0.014781465, -0.024650056, 0.03313333, -0.022936262, 0.0027188612, 0.03133385, -0.033418965, -0.018894568, 0.010289899, -0.012674928, 0.04784339, -0.012717772, 0.056041032, 0.009882873, 0.005719784, -8.729633E-4, 0.027220745, 0.0031901542, 0.0066909334, 0.026035372, 0.05027126, -0.061696548, -0.0020636923, -0.02343612, -0.028634625, -0.0035936097, -0.035047065, 0.027991952, -0.03453293, 0.023864567, 0.067866206, -0.0314481, 0.011668074, 0.025164194, -0.013574669, -0.017223619, -0.027749166, 0.028691752, -0.06215356, -0.007333606, -0.018894568, -0.012646364, -0.014838591, -0.02984856, 0.021422412, 0.006119669, -0.016809452, 0.023607498, 0.03276201, -0.001137173, 0.021922268, 0.030933963, 0.042702008, 0.05558402, -0.011653792, 0.0012969485, 0.036389537, 0.009954281, 0.06341034, 0.021879423, 0.042473502, -0.025706895, -0.00754783, 0.07026552, -0.01686658, -0.013174783, -0.010789755, 0.085575394, 0.029362986, 0.05958287, 0.08740345, -0.035446953, -0.041673735, 0.047900513, 0.073921606, -0.019451551, 0.014360157, -0.056326665, -0.009283045, 0.04304477, 0.019665774, 0.013367586, 0.024078792, -0.02664948, -0.032076493, -0.011860875, 0.0065302653, 1.6858992E-4, 0.035818275, -0.002522489, -0.049785685, 0.008818893, -0.02060836, -0.0069372915, 0.024921406, -0.054384366, 0.015338447, -0.0383604, -0.052499194, 0.0076406603, -0.012325028, 0.029591493, -0.013667499, -0.04430155, 0.026292441, 0.0562981, 0.005655517, -0.024264453, -0.044244424, -0.07112241, -0.03561833, -0.0082761925, 0.0035097052, -0.021993676, -0.05167086, -0.0253927, 0.02353609, 0.013717485, -0.037075054, 0.059182987, -0.029220171, -0.023093361, 0.006633807, -0.015824022, 0.06403873, 0.027020803, -0.016709482, 0.012824885, 0.038931664, -0.032476377, 0.0117109185, 0.009004554, 0.027806291, 0.03807477, -0.039445803, 0.03776057, -0.029620055, 0.036275286, -0.014074525, -0.015152787, -0.008926005, 0.04610103, 0.020165632, 0.0064302944, -0.053927355, 0.033676032, -0.0077477726, 3.9653777E-4, -2.5662265E-4, -9.4258616E-4, 0.051356662, 0.019280171, 0.0036703732, -0.044272985, -0.037589192, 0.00470579, 0.005019985, -0.008161939, -0.0014228052, -0.0073407465, 0.0028348994, -9.3366014E-4, -0.007940575, 0.0036846548, -0.009375876, -0.017223619, -0.038588904, 0.041816548, -0.021351004, 0.0073407465, -0.005409159, -0.03416161, 0.04698649, -0.002683157, -0.040445514, -0.009597241, -0.010525545, -0.003952435, -0.03161948, 0.023521809, 0.0015040318, 0.03481856, -0.0019904992, -0.04153092, 0.050471205, -0.009361594, -0.03124816, 0.03481856, -0.01492428, -0.00896885, 0.0025671192, -0.027506378, -0.058097582, -0.04641523, 0.016281033, -0.07460712, -0.02203652, -0.07814896, 0.041502353, 0.027492097, 0.010011408, 0.013603232, 0.0031812282, -0.009254483, -0.026149625, -0.035475515, -0.02086543, 0.01936586, 0.015838305, 0.04358747, -0.0229077, 0.017180774, 0.03513276, 0.06746632, -0.03436155, 0.032190744, -0.009511551, -0.0010586242, -0.043844536, -0.040359825, 0.044244424, -0.0051270975, 0.02513563, -0.016123936, -0.025549797, 0.03801764, -0.03224787, 0.020851148, -0.010175646, 0.04838609, 0.0253927, 0.020137068, 0.0246929, 0.014338735, -0.01952296, -0.0024582217, 0.041816548, 0.012574956, -0.026249597, -0.0035543353, 0.041787986, 0.035646893, 0.019151637, -0.012189353, -0.08009126, 0.02654951, -0.012096522, -0.083176084, -0.019651493, 0.004980711, 0.015224194, 0.04015988, 0.003170517, -0.0103970105, -0.0010943282, 0.037589192, -0.046815112, 0.01393885, -0.013817456, -0.005659087, 0.014795747, -0.013774611, 0.044330113, -0.02406451, -0.04055977, 0.0027367133, 0.032904826, 0.024621492, -0.00968293, -0.0064053014, 0.006198218, 0.0053234696, 0.016795171, 0.024450114, -0.019437268, 0.03721787, 0.008361882, -0.040245574, -0.017780602, 0.0077263503, 0.0047272122, -0.04307333, 0.047557756, -0.011168217, 0.019237326, -0.0091687925, -0.048985917, -0.034332987, -0.019465832, -0.009797183, -0.036875114, 0.008561824, 0.0023868138, 0.0012621371, 0.08031976, 0.013139079, -0.008397586, 0.038131893, -0.01109681, -0.0036043208, -0.04153092, 0.11573815, -0.031390976, 0.0024921407, 2.3229928E-4, 0.0040024207, 0.062324937, -0.018209051, -0.07792045, -0.019480113, 0.021465257, 0.0077834767, -0.014274468, -0.0073907324, -0.017280746, 0.009083102, -0.0033972375, 0.0069230096, 0.0029902118, 0.016838016, 0.03907448, 0.073864475, 0.021636637, -0.018594654, 0.0030509087, -0.032619193, -0.04404448, -0.04787195, -0.012360732, -0.006680222, 0.008997413, 0.004841465, 0.026321003, 0.0025974675, -0.023550373, 0.014624367, 0.021393849, -0.015381292, -0.05975425, 0.03624672, 0.019994251, -0.01500997, 0.041702297, 0.01979431, -0.0036810846, -0.0038024783, 0.01563836, 0.024021665, -0.04173086, -0.0014683278, 0.0062303515, -0.060496893, 0.0051449495, 0.040017065, -0.0028009804, 0.067809075, -0.002922374, 0.02440727, 0.009911437, 0.004570115, -0.055955343, 0.014267326, -0.004402306, -9.729346E-4, -0.018723188, -6.0919987E-4, -0.008354741, -0.011082528, 0.0077834767, 0.012210775, -0.030962527, 0.04918586, 0.004234497, 0.044787124, -0.001038987, -0.033019077, -0.008119094, 0.019722901, -0.032162182, -0.0013478268, -0.0018798166, 2.479198E-4, -0.036703732, -0.01011852, 0.0055019897, -0.0074907034, -0.014117369, -0.036903676, -0.029991377, 0.020594079, 0.027092211, 0.028220458, -0.005209217, 0.028748877, -0.035532642, -0.02105109, -0.020379854, 0.016966552, 0.03730356, -0.0011068246, -0.013638936, -0.020022815, 0.01829474, -0.010089956, 0.04264488, -0.021865143, 0.017266465, 0.0020922555, -0.035218447, -0.019651493, -0.022850573, -0.043358963, 0.026235314, 0.013160502, -0.061410915, 0.010632657, 0.068037584, 0.026606636, 0.009575819, 0.0136317955, -0.027991952, -0.020051379, 0.021008246, -0.010018548, -0.0115252575, -0.03713218, 0.033333275, -0.011582384, 0.02202224, 0.048243273, -0.011753764, -0.0028366845, 0.009547255, 0.00781918, 0.04644379, -0.021151062, 0.001349612, 0.010696924, -0.03107678, -0.03818902, 0.061410915, -0.06443862, -0.0628962, -0.08151942, -0.04895735, 0.009997126, 0.040188447, 0.03319046, -0.016937988, 0.01678089, 0.046129595, 0.03267632, 0.036360975, 0.027292153, 0.06695218, 0.047357813, 0.0016298885, -0.034018792, 0.008133376, 0.03473287, 0.007469281, 0.010604094, -0.0061410917, 0.0066980743, 0.0071872193, 0.008890301, 0.007583534, -0.01730931, -0.021022527, 0.01838043, -0.021965114, -0.051899366, 0.018466119, 0.05444149, 0.016623791, 0.051385228, -0.03527557, -0.031419538, 0.014124511, 0.0053163287, 0.025292728, -0.02477859, -0.038217586, -0.029705746, 0.032619193, -0.023636062, 0.06003988, -0.010611235, -0.016466694, -0.009011695, -0.01047556, -0.0035543353, -0.009040258, 0.026606636, 0.024607211, 0.0024671478, -0.03213362, 0.017280746, -0.038417526, -0.02326474, -0.0013728196, 0.020108504, 0.018351866, -0.009275905, 0.027520658, -0.008376163, -0.006526695, 0.010468419, -0.012760617, -0.03718931, 0.017494971, -0.0036275284, -0.013403289, -0.014003117, 0.012981982, 0.040274136, 0.012517829, 0.012389295, 0.0068158978, -0.025578361, 0.04724356, 0.060782526, 0.006623096, -0.05675511, 0.0031473094, 0.0145601, 0.039103042, -0.06295333, 0.04981425, -0.01688086, 0.05175655, 0.010089956, 0.02939155, -0.022350717, 0.008597529, 0.0136317955, 0.044758562, -0.034590054, 0.0025653339, -0.024392987, 0.07420724, -0.0018030531, 0.039817125, 0.03558977, -0.014710057, 0.033161893, -0.02157951, -0.02272204, 0.06329609, -0.0044772844, 0.004555833, -0.011646652, 0.003231214, 0.03941724, 0.05372741, -0.010025689, -0.056326665, 0.0017057596, -0.02494997, -0.0042666304, -0.002902737, 0.0024135918, -0.03613247, 0.03684655, 0.0051021045, 0.012232197, 0.052956205, -0.0058019035, 0.0015923993, 0.025207039, -0.0041309553, -0.026749453, 0.052984767, 0.025592642, 0.0061053876, 0.015524108, 0.019065946, 0.0035132756, -0.07574965, 0.003400808, -0.028006233, -0.015652644, 0.030591205, -0.01713793, 0.014274468, -0.006855172, -0.0626677, -0.019465832, -0.018866004, 0.016623791, -0.011046824, 0.013367586, -0.027920544, 0.018394712, 0.003488283, -0.0039738575, 0.02317905, 0.021251034, -0.0105826715, -0.029362986, -0.045586895, 0.039302986, 0.0075763934, -0.015681205, 0.020379854, 0.07609241, -0.077120684, -0.057412066, -0.04847178, 0.041930802, 0.008568965, 0.0071622264, 0.013417571, 0.03161948, -0.035646893, 0.004077399, -0.019237326, 0.0054734265, -0.012296465, -0.0049592885, 0.13047677, -0.015367011, 0.012667786, 0.017966263, 0.033704598, -0.018194769, 0.010968275, 0.026178189, -0.038960226, 0.053613156, -0.019651493, 0.0022457829, 0.022893418, -0.006648089, 0.013660358, -0.003809619, -0.011953706, -0.05512701, 0.012325028, 0.0012541037, -0.012203635, 5.132453E-4, 0.009075962, 0.029705746, -0.07637804, 0.02566405, 0.0017566378, -0.031133907, -0.016923705, -0.0019601507, 0.020751176, 0.008033405, -0.029148763, -0.011168217, -0.03710362, 0.028534653, -0.002583186, 0.03187655, -0.031219596, -0.009225919, 0.024550084, 0.012025114, -0.014638648, -0.021450976, 0.020365573, -0.044615746, -0.014060243, -0.012653505, 0.0246929, -0.020179912, 0.02060836, 0.030905401, 0.010639798, 0.061582293, 0.025321292, -0.0035097052, -0.004370172, 0.032447815, 0.023279022, -0.0035329128, -0.0075978157, 0.0041273846, -0.036903676, 0.050756834, -0.009468706, -0.005005704, 0.0068516014, -0.039331548, 0.03170517, -0.049957067, -0.014952844, 0.018009108, -0.05407017, -0.004223786, -0.032447815, 0.009375876, 0.0070586847, 0.00728005, -0.016181063, -0.006173225, 0.00506283, -0.004752205, -0.034504365, 0.033333275, -0.040017065, -0.02077974, 0.07272195, 0.013653218, -0.01713793, 0.0031223167, 0.020708332, 0.008004841, -0.003088398, 0.021122498, -0.010618376, -0.036360975, 5.7617365E-4, -0.044244424, -0.004909303, -0.015738333, -0.008176221, 0.018780315, 0.05061402, 6.5204466E-4, -0.010518405, 0.005369885, -0.08483275, -0.001722719, -0.032504942, 0.046929363, 0.0020226329, 0.018051952, 0.011039684, -3.2847698E-4, -0.0040202728, 0.01509566, -0.0056019607, -0.010596953, 0.031847987, 0.071522295, 0.016223907, -0.016366724, 0.05335609, 0.009425862, 0.026006809, -0.022507815, -0.0114252865, -0.034447238, -0.021793734, 0.03958862, 0.01047556, -0.05124241, -2.2326171E-4, -0.012860589, -0.039274424, 0.008868879, 0.013503261, -0.035047065, -0.024378706, 0.010754051, -0.008311896, -0.016195344, -0.045329824, -0.0036096766, -0.015752614, 0.051013906, 0.013638936, 0.033447526, 0.014274468, 0.0034650753, 0.03664661, -0.008997413, 0.02086543, -0.006330323, -0.049128734, -0.013089094, 8.90369E-4, -0.016081091, 0.019394424, -0.007733491, -0.006648089, -0.010811177, -0.033161893, -0.015923994, 0.035761148, -0.04678655, -0.037503503, 0.014281608, -0.0056519466, 0.0069194394, 0.00399528, 0.0054484336, -0.0015093875, -0.02406451, -0.019680057, 0.0038310415, 0.014810028, -0.022921981, 0.0051128156, 0.018537527, -0.006972995, 0.031019654, 0.050728273, -0.042587757, 0.0035936097, 0.006633807, -0.008890301, -0.013931709, 0.019051665, 0.025249884, -0.040902525, 9.0241915E-4, 0.02564977, -0.012110804, 7.185434E-4, 0.012496407, -0.030448388, -0.064324364, 0.0241502, -0.058383215, 0.06403873, -0.051213846, 0.029248733, -0.03507563, 0.004680797, 0.06820896, -0.07437862, -0.052613445, 0.025464108, 0.0021600933, 0.053584594, 0.031505227, -0.005826896, 0.022836292, -0.0068658832, -0.030419827, 0.010711206, 0.036532354, -0.0116609335, 0.009540115, -0.0040988214, -0.022122212, -0.0028741737, -0.038874537, -0.020379854, 0.018323304, 0.021450976, 0.021208188, 0.024792872, -0.02939155, -0.03801764, -0.06038264, -0.040245574, -0.03347609, 0.029177327, 0.01358895, 0.02103681, 0.0049557183, -0.004502277, -0.031933676, 0.012739195, -0.052984767, 0.018508965, -0.051270973, -0.013010546, 0.067809075, -0.011546681, 0.027306436, 0.008333319, -0.047700573, 0.037075054, 0.02343612, -0.017437844, -0.061696548, -0.010861163, 0.017637786, 0.011218203, 0.028263303, 0.06278195, 0.022179337, -5.003026E-4, 0.055526894, -0.011125373, 0.010896867, -0.040274136, -0.020322729, -0.0023832433, 0.02317905, 0.049785685, -0.039560053, 0.041388102, 0.037617758, 0.001105932, 0.00470579, -0.0023689617, 0.0057483474, -0.02255066, 0.04750063, 4.054638E-4, 0.03276201]'
)
LIMIT 10;
+------+--------------------+--------------+-------+---------------------+
| id   | title              | category     | price | score               |
+------+--------------------+--------------+-------+---------------------+
| p001 | 无线降噪耳机       | 数码配件     | 399.0 |  0.7290722727775574 |
| p005 | 户外冲锋衣         | 运动户外     | 599.0 | 0.47925230860710144 |
| p003 | 儿童保温杯         | 母婴用品     |  89.0 | 0.46468326449394226 |
| p002 | 机械键盘           | 电脑外设     | 269.0 |  0.4509061872959137 |
| p004 | 空气炸锅           | 厨房电器     | 329.0 |  0.4198461174964905 |
+------+--------------------+--------------+-------+---------------------+
5 rows in set (0.04 sec)