我们正在测试 ** solr 9.2** 密集向量搜索
首先,我们编辑了managed-schema.xml:
<fieldType name="knn_vector" class="solr.DenseVectorField" vectorDimension="4"/>
<dynamicField name="*_vtr" type="knn_vector" indexed="true" stored="true"/>
然后,我们重启Solr。
接下来,我们创建了一个小合集:
curl --request POST \
--url http://localhost:8983/api/collections \
--header 'Content-Type: application/json' \
--data '{
"create": {
"name": "teste7",
"numShards": 1,
"replicationFactor": 1
}
}'
然后,我们插入并提交数据:
curl --request POST \
--url 'http://localhost:8983/api/collections/teste7/update' \
--header 'Content-Type: application/json' \
--data ' [{ "id": "1",
"vector2_vtr": [1.0, 2.5, 3.7, 4.1]
},
{ "id": "2",
"vector2_vtr": [1.5, 5.5, 6.7, 65.1]
}
]'
和
curl -X POST -H 'Content-type: application/json' -d '{"set-property":{"updateHandler.autoCommit.maxTime":15000}}' http://localhost:8983/api/collections/teste7/config
这是数据
这是架构
但是,当我们搜索
q={!knn f=vector2_vtr topK=10}[1.0, 2.0, 3.0, 4.0]
我们收到错误:
"error-class","org.apache.solr.common.SolrException", "root-error-class","org.apache.solr.common.SolrException"], "msg":"only DenseVectorField is compatible with Knn Query Parser",
密集向量搜索相对较新,我们找不到太多信息或完整示例。
有理想吗?