manticoresoftware / manticoresearch

Easy to use open source fast database for search | Good alternative to Elasticsearch now | Drop-in replacement for E in the ELK soon
https://manticoresearch.com
GNU General Public License v3.0
9.07k stars 509 forks source link

switched buddy reply parsing to CJson from the BJson to work same way as HTTP JSON parser #2730

Closed tomatolog closed 2 weeks ago

tomatolog commented 2 weeks ago

to test all buddy cases at CI

github-actions[bot] commented 2 weeks ago

clt

👎 CLT tests in test/clt-tests/core/ test/clt-tests/expected-errors/ ✅ OK: 27 ❌ Failed: 1 ⏳ Duration: 348s 👉 Check Action Results for commit fd64880 Failed tests:

test/clt-tests/core/test-knn-id.rec ```diff ––– input ––– rm -f /var/log/manticore/searchd.log; searchd --stopwait > /dev/null; searchd; if timeout 10 grep -qm1 '\[BUDDY\] started' <(tail -n 1000 -f /var/log/manticore/searchd.log); then echo 'Buddy started!'; else echo 'Timeout or failed!'; cat /var/log/manticore/searchd.log;fi ––– output ––– Manticore %{SEMVER} %{COMMITDATE}#!/(\sdev)?\s/!#(columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE}) Copyright (c) 2001-2016, Andrew Aksyonoff Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com) Copyright (c) 2017-%{YEAR}, Manticore Software LTD (https://manticoresearch.com) [#!/[0-9]{2}:[0-9]{2}.[0-9]{3}/!#] [#!/[0-9]+/!#] using config file '/etc/manticoresearch/manticore.conf' (%{NUMBER} chars)... starting daemon version '%{SEMVER} %{COMMITDATE}#!/(\sdev)?\s/!#(columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE})' ... listening on %{IPADDR}:9312 for sphinx and http(s) listening on %{IPADDR}:9306 for mysql listening on %{IPADDR}:9308 for sphinx and http(s) Buddy started! ––– input ––– mysql -h0 -P9306 -e "create table test ( title text, image_vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2' );" ––– output ––– ––– input ––– mysql -h0 -P9306 -e "insert into test values ( 1, 'yellow bag', (0.653448,0.192478,0.017971,0.339821) ), ( 2, 'white bag', (-0.148894,0.748278,0.091892,-0.095406) );" ––– output ––– ––– input ––– mysql -h0 -P9306 -e "select id, knn_dist() from test where knn ( image_vector, 5, (0.286569,-0.031816,0.066684,0.032926), 2000 );" ––– output ––– +------+------------+ | id | knn_dist() | +------+------------+ | 1 | 0.28146550 | | 2 | 0.81527930 | +------+------------+ ––– input ––– mysql -h0 -P9306 -e "select id, knn_dist() from test where knn ( image_vector, 5, 1 );" ––– output ––– - +------+------------+ - | id | knn_dist() | - +------+------------+ - | 2 | 1.14755321 | - +------+------------+ ––– input ––– mysql -h0 -P9306 -e "select * from test where knn ( image_vector, 5, 1 );" ––– output ––– - +------+-----------+---------------------------------------+------------+ - | id | title | image_vector | @knn_dist | - +------+-----------+---------------------------------------+------------+ - | 2 | white bag | -0.148894,0.748278,0.091892,-0.095406 | 1.14755321 | - +------+-----------+---------------------------------------+------------+ ––– input ––– mysql -h0 -P9306 -e "select count(*) from test where knn ( image_vector, 5, 1 );" ––– output ––– +----------+ | count(*) | +----------+ | 2 | +----------+ ––– input ––– mysql -h0 -P9306 -e "CREATE TABLE knn_test (id BIGINT, model TEXT, color TEXT, sold BOOL, date_added BIGINT, storage_capacity UINT, release_year UINT, price FLOAT, discounted_price FLOAT, product_codes JSON, values JSON, additional_info JSON, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2');" ––– output ––– ––– input ––– mysql -h0 -P9306 -e "INSERT INTO knn_test (id, model, color, sold, date_added, storage_capacity, release_year, price, discounted_price, product_codes, values, additional_info, vector) VALUES (1, 'Model_1', 'Color_1', 1, 1620590570251, 512, 2022, 654.19, 855.34, '[81,56,60]', '[96,389,27]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.1, 0.2, 0.3, 0.4)), (2, 'Model_2', 'Color_2', 1, 1689374130160, 128, 2020, 663.70, 767.99, '[12,39,30]', '[226,305,123]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.286569, -0.031816, 0.066684, 0.032926)), (3, 'Model_3', 'Color_3', 0, 1640782021529, 512, 2020, 676.46, 847.08, '[62,13,4]', '[707,601,608]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.5, 0.7, -0.1, 0.2)), (4, 'Model_4', 'Color_4', 0, 1615319697581, 128, 2020, 424.23, 883.90, '[98,96,89]', '[166,252,510]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.7, -0.8, 0.1, -0.2)), (5, 'Model_5', 'Color_5', 1, 1671157942660, 128, 2021, 1173.29, 977.33, '[27,12,37]', '[988,87,21]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.3, 0.4, 0.5, 0.6)), (6, 'Model_6', 'Color_6', 0, 1609876342571, 256, 2021, 755.99, 665.49, '[5,15,25]', '[15,100,500]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.2, 0.4, -0.6, 0.8)), (7, 'Model_7', 'Color_7', 1, 1648765432160, 64, 2019, 299.99, 199.99, '[77,88,99]', '[99,888,555]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.5, -0.3, 0.9, -0.1)), (8, 'Model_8', 'Color_8', 0, 1654876543130, 256, 2019, 800.99, 699.99, '[22,33,44]', '[66,333,999]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.8, 0.6, 0.2, -0.4)), (9, 'Model_9', 'Color_9', 1, 1631567882541, 128, 2022, 499.99, 399.99, '[11,22,33]', '[111,222,333]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.1, 0.3, -0.5, 0.7)), (10, 'Model_10', 'Color_10', 0, 1678956543120, 512, 2022, 1299.99, 1099.99, '[9,8,7]', '[555,444,333]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.9, 0.1, 0.8, -0.2));" ––– output ––– ––– input ––– mysql -h0 -P9306 -e "SELECT id, knn_dist() FROM knn_test WHERE knn(vector, 5, 1);" ––– output ––– - +------+------------+ - | id | knn_dist() | - +------+------------+ - | 5 | 0.16000001 | - | 2 | 0.27772635 | - | 9 | 0.78000003 | - | 3 | 0.81000006 | - | 7 | 1.020000 | - | 6 | 1.100000 | - | 10 | 1.260000 | - | 8 | 1.300000 | - | 4 | 1.75999987 | - +------+------------+ ––– input ––– mysql -h0 -P9306 -e "SELECT id, knn_dist() FROM knn_test WHERE knn(vector, 5, 1);" ––– output ––– - +------+------------+ - | id | knn_dist() | - +------+------------+ - | 5 | 0.16000001 | - | 2 | 0.27772635 | - | 9 | 0.78000003 | - | 3 | 0.81000006 | - | 7 | 1.020000 | - | 6 | 1.100000 | - | 10 | 1.260000 | - | 8 | 1.300000 | - | 4 | 1.75999987 | - +------+------------+ ––– input ––– mysql -h0 -P9306 -e "SELECT * FROM knn_test WHERE knn(vector, 5, 1);" ––– output ––– - +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+ - | id | model | color | sold | date_added | storage_capacity | release_year | price | discounted_price | product_codes | values | additional_info | vector | @knn_dist | - +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+ - | 5 | Model_5 | Color_5 | 1 | 1671157942660 | 128 | 2021 | 1173.290039 | 977.330017 | [27,12,37] | [988,87,21] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.300000,0.400000,0.500000,0.600000 | 0.16000001 | - | 2 | Model_2 | Color_2 | 1 | 1689374130160 | 128 | 2020 | 663.700012 | 767.989990 | [12,39,30] | [226,305,123] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.286569,-0.031816,0.066684,0.032926 | 0.27772635 | - | 9 | Model_9 | Color_9 | 1 | 1631567882541 | 128 | 2022 | 499.989990 | 399.989990 | [11,22,33] | [111,222,333] | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.100000,0.300000,-0.500000,0.700000 | 0.78000003 | - | 3 | Model_3 | Color_3 | 0 | 1640782021529 | 512 | 2020 | 676.460022 | 847.080017 | [62,13,4] | [707,601,608] | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.500000,0.700000,-0.100000,0.200000 | 0.81000006 | - | 7 | Model_7 | Color_7 | 1 | 1648765432160 | 64 | 2019 | 299.989990 | 199.990005 | [77,88,99] | [99,888,555] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.500000,-0.300000,0.900000,-0.100000 | 1.020000 | - | 6 | Model_6 | Color_6 | 0 | 1609876342571 | 256 | 2021 | 755.989990 | 665.489990 | [5,15,25] | [15,100,500] | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.200000,0.400000,-0.600000,0.800000 | 1.100000 | - | 10 | Model_10 | Color_10 | 0 | 1678956543120 | 512 | 2022 | 1299.989990 | 1099.989990 | [9,8,7] | [555,444,333] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.900000,0.100000,0.800000,-0.200000 | 1.260000 | - | 8 | Model_8 | Color_8 | 0 | 1654876543130 | 256 | 2019 | 800.989990 | 699.989990 | [22,33,44] | [66,333,999] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.800000,0.600000,0.200000,-0.400000 | 1.300000 | - | 4 | Model_4 | Color_4 | 0 | 1615319697581 | 128 | 2020 | 424.230011 | 883.900024 | [98,96,89] | [166,252,510] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.700000,-0.800000,0.100000,-0.200000 | 1.75999987 | - +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+ ––– input ––– mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test WHERE knn(vector, 5, 1);" ––– output ––– +----------+ | count(*) | +----------+ | 10 | +----------+ ```