-
-
Notifications
You must be signed in to change notification settings - Fork 514
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
🆕 Update buddy version (feature/cli-table-output) #2701
Conversation
clt👎 CLT tests in test/clt-tests/core/test-knn-id.rec––– 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 |
+ | 1 | 0 |
- +------+------------+
+ | 2 | 1.14755321 |
+ +------+------------+
––– input –––
mysql -h0 -P9306 -e "select * from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+-----------+---------------------------------------+------------+
+ +------+------------+---------------------------------------+------------+
- | id | title | image_vector | @knn_dist |
+ | id | title | image_vector | @knn_dist |
- +------+-----------+---------------------------------------+------------+
+ +------+------------+---------------------------------------+------------+
- | 2 | white bag | -0.148894,0.748278,0.091892,-0.095406 | 1.14755321 |
+ | 1 | yellow bag | 0.653448,0.192478,0.017971,0.339821 | 0 |
- +------+-----------+---------------------------------------+------------+
+ | 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 |
+ | 1 | 0 |
- | 2 | 0.27772635 |
+ | 5 | 0.16000001 |
- | 9 | 0.78000003 |
+ | 2 | 0.27772635 |
- | 3 | 0.81000006 |
+ | 9 | 0.78000003 |
- | 7 | 1.020000 |
+ | 3 | 0.81000006 |
- | 6 | 1.100000 |
+ | 7 | 1.020000 |
- | 10 | 1.260000 |
+ | 6 | 1.100000 |
- | 8 | 1.300000 |
+ | 10 | 1.260000 |
- | 4 | 1.75999987 |
+ | 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 |
+ | 1 | 0 |
- | 2 | 0.27772635 |
+ | 5 | 0.16000001 |
- | 9 | 0.78000003 |
+ | 2 | 0.27772635 |
- | 3 | 0.81000006 |
+ | 9 | 0.78000003 |
- | 7 | 1.020000 |
+ | 3 | 0.81000006 |
- | 6 | 1.100000 |
+ | 7 | 1.020000 |
- | 10 | 1.260000 |
+ | 6 | 1.100000 |
- | 8 | 1.300000 |
+ | 10 | 1.260000 |
- | 4 | 1.75999987 |
+ | 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 |
+ | 1 | Model_1 | Color_1 | 1 | 1620590570251 | 512 | 2022 | 654.190002 | 855.340027 | [81,56,60] | [96,389,27] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.100000,0.200000,0.300000,0.400000 | 0 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
+----------+
|
clt👎 CLT tests in test/clt-tests/core/test-knn-id.rec––– 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 |
+ | 1 | 0 |
- +------+------------+
+ | 2 | 1.14755321 |
+ +------+------------+
––– input –––
mysql -h0 -P9306 -e "select * from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+-----------+---------------------------------------+------------+
+ +------+------------+---------------------------------------+------------+
- | id | title | image_vector | @knn_dist |
+ | id | title | image_vector | @knn_dist |
- +------+-----------+---------------------------------------+------------+
+ +------+------------+---------------------------------------+------------+
- | 2 | white bag | -0.148894,0.748278,0.091892,-0.095406 | 1.14755321 |
+ | 1 | yellow bag | 0.653448,0.192478,0.017971,0.339821 | 0 |
- +------+-----------+---------------------------------------+------------+
+ | 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 |
+ | 1 | 0 |
- | 2 | 0.27772635 |
+ | 5 | 0.16000001 |
- | 9 | 0.78000003 |
+ | 2 | 0.27772635 |
- | 3 | 0.81000006 |
+ | 9 | 0.78000003 |
- | 7 | 1.020000 |
+ | 3 | 0.81000006 |
- | 6 | 1.100000 |
+ | 7 | 1.020000 |
- | 10 | 1.260000 |
+ | 6 | 1.100000 |
- | 8 | 1.300000 |
+ | 10 | 1.260000 |
- | 4 | 1.75999987 |
+ | 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 |
+ | 1 | 0 |
- | 2 | 0.27772635 |
+ | 5 | 0.16000001 |
- | 9 | 0.78000003 |
+ | 2 | 0.27772635 |
- | 3 | 0.81000006 |
+ | 9 | 0.78000003 |
- | 7 | 1.020000 |
+ | 3 | 0.81000006 |
- | 6 | 1.100000 |
+ | 7 | 1.020000 |
- | 10 | 1.260000 |
+ | 6 | 1.100000 |
- | 8 | 1.300000 |
+ | 10 | 1.260000 |
- | 4 | 1.75999987 |
+ | 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 |
+ | 1 | Model_1 | Color_1 | 1 | 1620590570251 | 512 | 2022 | 654.190002 | 855.340027 | [81,56,60] | [96,389,27] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.100000,0.200000,0.300000,0.400000 | 0 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
+----------+
|
clt👎 CLT tests in test/clt-tests/core/test-knn-id.rec––– 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 |
+ | 1 | 0 |
- +------+------------+
+ | 2 | 1.14755321 |
+ +------+------------+
––– input –––
mysql -h0 -P9306 -e "select * from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+-----------+---------------------------------------+------------+
+ +------+------------+---------------------------------------+------------+
- | id | title | image_vector | @knn_dist |
+ | id | title | image_vector | @knn_dist |
- +------+-----------+---------------------------------------+------------+
+ +------+------------+---------------------------------------+------------+
- | 2 | white bag | -0.148894,0.748278,0.091892,-0.095406 | 1.14755321 |
+ | 1 | yellow bag | 0.653448,0.192478,0.017971,0.339821 | 0 |
- +------+-----------+---------------------------------------+------------+
+ | 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 |
+ | 1 | 0 |
- | 2 | 0.27772635 |
+ | 5 | 0.16000001 |
- | 9 | 0.78000003 |
+ | 2 | 0.27772635 |
- | 3 | 0.81000006 |
+ | 9 | 0.78000003 |
- | 7 | 1.020000 |
+ | 3 | 0.81000006 |
- | 6 | 1.100000 |
+ | 7 | 1.020000 |
- | 10 | 1.260000 |
+ | 6 | 1.100000 |
- | 8 | 1.300000 |
+ | 10 | 1.260000 |
- | 4 | 1.75999987 |
+ | 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 |
+ | 1 | 0 |
- | 2 | 0.27772635 |
+ | 5 | 0.16000001 |
- | 9 | 0.78000003 |
+ | 2 | 0.27772635 |
- | 3 | 0.81000006 |
+ | 9 | 0.78000003 |
- | 7 | 1.020000 |
+ | 3 | 0.81000006 |
- | 6 | 1.100000 |
+ | 7 | 1.020000 |
- | 10 | 1.260000 |
+ | 6 | 1.100000 |
- | 8 | 1.300000 |
+ | 10 | 1.260000 |
- | 4 | 1.75999987 |
+ | 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 |
+ | 1 | Model_1 | Color_1 | 1 | 1620590570251 | 512 | 2022 | 654.190002 | 855.340027 | [81,56,60] | [96,389,27] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.100000,0.200000,0.300000,0.400000 | 0 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
+----------+
|
clt👎 CLT tests in test/clt-tests/core/show-version-http.rec––– 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 t (id INT, value TEXT); INSERT INTO t VALUES (1, 'example'), (2, 'test');"
––– output –––
––– input –––
curl -s "http://localhost:9308/cli?show%20version" | awk '!/row.*in set/'; echo
––– output –––
+-----------+----------------------------------+
| Component | Version |
+-----------+----------------------------------+
- | Daemon | 6.3.7 2ed25bd4a@24111811 dev |
+ | Daemon | 6.3.7 b55900233@24112019 dev |
| Columnar | columnar 2.3.1 30ad2d6@24100914 |
| Secondary | secondary 2.3.1 30ad2d6@24100914 |
| KNN | knn 2.3.1 30ad2d6@24100914 |
| Buddy | buddy v3.0.1 |
+-----------+----------------------------------+
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | awk '!/row.*in set/'; echo
––– output –––
+-------+------+
| Table | Type |
+-------+------+
| t | rt |
+-------+------+
––– input –––
curl -s "http://localhost:9308/cli?select%20*%20from%20t%20where%20match('example')" | awk '!/row.*in set/'; echo
––– output –––
+----+---------+
| id | value |
+----+---------+
| 1 | example |
+----+---------+
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show version"; echo
––– output –––
- [{"total":5,"error":"","warning":"","columns":[{"Component":{"type":"string"}},{"Version":{"type":"string"}}],"data":[{"Component":"Daemon","Version":"6.3.7 2ed25bd4a@24111811 dev"},{"Component":"Columnar","Version":"columnar 2.3.1 30ad2d6@24100914"},{"Component":"Secondary","Version":"secondary 2.3.1 30ad2d6@24100914"},{"Component":"KNN","Version":"knn 2.3.1 30ad2d6@24100914"},{"Component":"Buddy","Version":"buddy v3.0.1"}]}]
+ [{"total":5,"error":"","warning":"","columns":[{"Component":{"type":"string"}},{"Version":{"type":"string"}}],"data":[{"Component":"Daemon","Version":"6.3.7 b55900233@24112019 dev"},{"Component":"Columnar","Version":"columnar 2.3.1 30ad2d6@24100914"},{"Component":"Secondary","Version":"secondary 2.3.1 30ad2d6@24100914"},{"Component":"KNN","Version":"knn 2.3.1 30ad2d6@24100914"},{"Component":"Buddy","Version":"buddy v3.0.1"}]}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
{"Table":"t","Type":"rt"}
],
"total":1,
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "select * from t where match('example')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
{"id":1,"value":"example"}
],
"total":1,
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql" -d "select * from t"; echo
––– output –––
{"took":%{NUMBER},"timed_out":false,"hits":{"total":2,"total_relation":"eq","hits":[{"_id":1,"_score":1,"_source":{"value":"example"}},{"_id":2,"_score":1,"_source":{"value":"test"}}]}}
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "select * from t"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
{"id":1,"value":"example"},
{"id":2,"value":"test"}
],
"total":2,
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
{"Table":"t","Type":"rt"}
],
"total":1,
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "select * from t where match('nonexistent')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
],
"total":0,
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "select * from t where match('nonexistent')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
],
"total":0,
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | sed '/row.*in set/d' | sed 's/ (.*sec)//'; echo
––– output –––
+-------+------+
| Table | Type |
+-------+------+
| t | rt |
+-------+------+
––– input –––
curl -s "http://localhost:9308/cli?describe%20t" | awk '!/row.*in set/'; echo
––– output –––
+-------+--------+----------------+
| Field | Type | Properties |
+-------+--------+----------------+
| id | bigint | |
| value | text | indexed stored |
+-------+--------+----------------+
––– input –––
curl -s "http://localhost:9308/cli_json" -d "DESCRIBE t"; echo
––– output –––
[{
"columns":[{"Field":{"type":"string"}},{"Type":{"type":"string"}},{"Properties":{"type":"string"}}],
"data":[
{"Field":"id","Type":"bigint","Properties":""},
{"Field":"value","Type":"text","Properties":"indexed stored"}
],
"total":2,
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?drop%20table%20t" | awk '!/Query OK/ && !/rows affected/'; echo
––– output –––
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
],
"total":0,
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | sed 's/ (.*sec)//'; echo
––– output –––
Empty set
––– input –––
curl -s "http://localhost:9308/cli_json" -d "SHOW STATUS"; echo
––– output –––
[{
"columns":[{"Counter":{"type":"string"}},{"Value":{"type":"string"}}],
"data":[
- {"Counter":"uptime","Value":"2"},
+ {"Counter":"uptime","Value":"1"},
- {"Counter":"connections","Value":"28"},
+ {"Counter":"connections","Value":"24"},
{"Counter":"maxed_out","Value":"0"},
- {"Counter":"version","Value":"6.3.7 2ed25bd4a@24111811 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914) (buddy v3.0.1)"},
+ {"Counter":"version","Value":"6.3.7 b55900233@24112019 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914) (buddy v3.0.1)"},
- {"Counter":"mysql_version","Value":"6.3.7 2ed25bd4a@24111811 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914)"},
+ {"Counter":"mysql_version","Value":"6.3.7 b55900233@24112019 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914)"},
- {"Counter":"command_search","Value":"6"},
+ {"Counter":"command_search","Value":"5"},
{"Counter":"command_excerpt","Value":"0"},
{"Counter":"command_update","Value":"0"},
{"Counter":"command_keywords","Value":"0"},
{"Counter":"command_persist","Value":"0"},
{"Counter":"command_status","Value":"3"},
{"Counter":"command_flushattrs","Value":"0"},
{"Counter":"command_sphinxql","Value":"0"},
{"Counter":"command_ping","Value":"0"},
{"Counter":"command_delete","Value":"0"},
{"Counter":"command_set","Value":"0"},
{"Counter":"command_insert","Value":"1"},
{"Counter":"command_replace","Value":"0"},
{"Counter":"command_commit","Value":"0"},
{"Counter":"command_suggest","Value":"0"},
{"Counter":"command_json","Value":"0"},
{"Counter":"command_callpq","Value":"0"},
{"Counter":"command_cluster","Value":"0"},
{"Counter":"command_getfield","Value":"0"},
{"Counter":"insert_replace_stats_ms_avg","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_min","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_max","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_pct95","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_pct99","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_avg","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_min","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_max","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_pct95","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_pct99","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"update_stats_ms_avg","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_min","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_max","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_pct95","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_pct99","Value":"N/A N/A N/A"},
{"Counter":"agent_connect","Value":"0"},
{"Counter":"agent_tfo","Value":"0"},
{"Counter":"agent_retry","Value":"0"},
{"Counter":"queries","Value":"6"},
{"Counter":"dist_queries","Value":"0"},
- {"Counter":"workers_total","Value":"8"},
+ {"Counter":"workers_total","Value":"4"},
{"Counter":"workers_active","Value":"4"},
{"Counter":"workers_clients","Value":"2"},
{"Counter":"workers_clients_vip","Value":"0"},
{"Counter":"workers_clients_buddy","Value":"1"},
{"Counter":"work_queue_length","Value":"6"},
{"Counter":"load","Value":"0.00 0.00 0.00"},
{"Counter":"load_primary","Value":"0.00 0.00 0.00"},
{"Counter":"load_secondary","Value":"0.00 0.00 0.00"},
{"Counter":"query_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"query_cpu","Value":"OFF"},
{"Counter":"dist_wall","Value":"0.000"},
{"Counter":"dist_local","Value":"0.000"},
{"Counter":"dist_wait","Value":"0.000"},
{"Counter":"query_reads","Value":"OFF"},
{"Counter":"query_readkb","Value":"OFF"},
{"Counter":"query_readtime","Value":"OFF"},
- {"Counter":"avg_query_wall","Value":"0.001"},
+ {"Counter":"avg_query_wall","Value":"0.000"},
{"Counter":"avg_query_cpu","Value":"OFF"},
{"Counter":"avg_dist_wall","Value":"0.000"},
{"Counter":"avg_dist_local","Value":"0.000"},
{"Counter":"avg_dist_wait","Value":"0.000"},
{"Counter":"avg_query_reads","Value":"OFF"},
{"Counter":"avg_query_readkb","Value":"OFF"},
{"Counter":"avg_query_readtime","Value":"OFF"},
{"Counter":"qcache_max_bytes","Value":"16777216"},
{"Counter":"qcache_thresh_msec","Value":"3000"},
{"Counter":"qcache_ttl_sec","Value":"60"},
{"Counter":"qcache_cached_queries","Value":"0"},
{"Counter":"qcache_used_bytes","Value":"0"},
{"Counter":"qcache_hits","Value":"0"}
],
"total":75,
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20status" | awk '!/row.*in set/'; echo
––– output –––
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| Counter | Value |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | uptime | 2 |
+ | uptime | 1 |
- | connections | 29 |
+ | connections | 25 |
| maxed_out | 0 |
- | version | 6.3.7 2ed25bd4a@24111811 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914) (buddy v3.0.1) |
+ | version | 6.3.7 b55900233@24112019 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914) (buddy v3.0.1) |
- | mysql_version | 6.3.7 2ed25bd4a@24111811 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914) |
+ | mysql_version | 6.3.7 b55900233@24112019 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914) |
- | command_search | 6 |
+ | command_search | 5 |
| command_excerpt | 0 |
| command_update | 0 |
| command_keywords | 0 |
| command_persist | 0 |
| command_status | 4 |
| command_flushattrs | 0 |
| command_sphinxql | 0 |
| command_ping | 0 |
| command_delete | 0 |
| command_set | 0 |
| command_insert | 1 |
| command_replace | 0 |
| command_commit | 0 |
| command_suggest | 0 |
| command_json | 0 |
| command_callpq | 0 |
| command_cluster | 0 |
| command_getfield | 0 |
| insert_replace_stats_ms_avg | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_min | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_max | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_pct95 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_pct99 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_avg | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_min | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_max | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_pct95 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_pct99 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| update_stats_ms_avg | N/A N/A N/A |
| update_stats_ms_min | N/A N/A N/A |
| update_stats_ms_max | N/A N/A N/A |
| update_stats_ms_pct95 | N/A N/A N/A |
| update_stats_ms_pct99 | N/A N/A N/A |
| agent_connect | 0 |
| agent_tfo | 0 |
| agent_retry | 0 |
| queries | 6 |
| dist_queries | 0 |
- | workers_total | 8 |
+ | workers_total | 4 |
| workers_active | 4 |
| workers_clients | 2 |
| workers_clients_vip | 0 |
| workers_clients_buddy | 1 |
| work_queue_length | 6 |
| load | 0.00 0.00 0.00 |
| load_primary | 0.00 0.00 0.00 |
| load_secondary | 0.00 0.00 0.00 |
| query_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| query_cpu | OFF |
| dist_wall | 0.000 |
| dist_local | 0.000 |
| dist_wait | 0.000 |
| query_reads | OFF |
| query_readkb | OFF |
| query_readtime | OFF |
| avg_query_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_query_cpu | OFF |
| avg_dist_wall | 0.000 |
| avg_dist_local | 0.000 |
| avg_dist_wait | 0.000 |
| avg_query_reads | OFF |
| avg_query_readkb | OFF |
| avg_query_readtime | OFF |
| qcache_max_bytes | 16777216 |
| qcache_thresh_msec | 3000 |
| qcache_ttl_sec | 60 |
| qcache_cached_queries | 0 |
| qcache_used_bytes | 0 |
| qcache_hits | 0 |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE big_table (id INT, value TEXT);"
––– output –––
––– input –––
for i in $(seq 1 1000000); do echo "INSERT INTO big_table VALUES ($i, 'value_$i');"; done | mysql -h0 -P9306
––– output –––
––– input –––
curl -s "http://localhost:9308/cli?select%20*%20from%20big_table%20limit%2010" | awk '!/row.*in set/'; echo
––– output –––
+--------+--------------+
| id | value |
+--------+--------------+
| 939142 | value_939142 |
| 418023 | value_418023 |
| 418022 | value_418022 |
| 939140 | value_939140 |
| 418021 | value_418021 |
| 939141 | value_939141 |
| 418020 | value_418020 |
| 939138 | value_939138 |
| 939139 | value_939139 |
| 418019 | value_418019 |
+--------+--------------+
––– input –––
curl -s "http://localhost:9308/cli?select%20count(*)%20as%20total%20from%20big_table" | awk '!/row.*in set/'; echo
––– output –––
+---------+
| total |
+---------+
| 1000000 |
+---------+
––– input –––
curl -s "http://localhost:9308/cli?drop%20table%20big_table" | awk '!/Query OK/ && !/rows affected/'; echo
––– output –––
––– input –––
curl -X POST "http://localhost:9308/sql" -d "EXPLAIN FORMAT=json SELECT * FROM t WHERE MATCH('example')"; echo
––– output –––
{"error":"P01: syntax error, unexpected '=' near '=json SELECT * FROM t WHERE MATCH('example')'"}
test/clt-tests/core/test-knn-id.rec––– 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 |
+ | 1 | 0 |
- +------+------------+
+ | 2 | 1.14755321 |
+ +------+------------+
––– input –––
mysql -h0 -P9306 -e "select * from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+-----------+---------------------------------------+------------+
+ +------+------------+---------------------------------------+------------+
- | id | title | image_vector | @knn_dist |
+ | id | title | image_vector | @knn_dist |
- +------+-----------+---------------------------------------+------------+
+ +------+------------+---------------------------------------+------------+
- | 2 | white bag | -0.148894,0.748278,0.091892,-0.095406 | 1.14755321 |
+ | 1 | yellow bag | 0.653448,0.192478,0.017971,0.339821 | 0 |
- +------+-----------+---------------------------------------+------------+
+ | 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 |
+ | 1 | 0 |
- | 2 | 0.27772635 |
+ | 5 | 0.16000001 |
- | 9 | 0.78000003 |
+ | 2 | 0.27772635 |
- | 3 | 0.81000006 |
+ | 9 | 0.78000003 |
- | 7 | 1.020000 |
+ | 3 | 0.81000006 |
- | 6 | 1.100000 |
+ | 7 | 1.020000 |
- | 10 | 1.260000 |
+ | 6 | 1.100000 |
- | 8 | 1.300000 |
+ | 10 | 1.260000 |
- | 4 | 1.75999987 |
+ | 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 |
+ | 1 | 0 |
- | 2 | 0.27772635 |
+ | 5 | 0.16000001 |
- | 9 | 0.78000003 |
+ | 2 | 0.27772635 |
- | 3 | 0.81000006 |
+ | 9 | 0.78000003 |
- | 7 | 1.020000 |
+ | 3 | 0.81000006 |
- | 6 | 1.100000 |
+ | 7 | 1.020000 |
- | 10 | 1.260000 |
+ | 6 | 1.100000 |
- | 8 | 1.300000 |
+ | 10 | 1.260000 |
- | 4 | 1.75999987 |
+ | 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 |
+ | 1 | Model_1 | Color_1 | 1 | 1620590570251 | 512 | 2022 | 654.190002 | 855.340027 | [81,56,60] | [96,389,27] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.100000,0.200000,0.300000,0.400000 | 0 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
- | 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 |
+ | 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 |
+----------+
|
clt👎 CLT tests in test/clt-tests/core/show-version-http.rec––– 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 t (id INT, value TEXT); INSERT INTO t VALUES (1, 'example'), (2, 'test');"
––– output –––
––– input –––
curl -s "http://localhost:9308/cli?show%20version" | awk '!/row.*in set/'; echo
––– output –––
+-----------+----------------------------------+
| Component | Version |
+-----------+----------------------------------+
- | Daemon | 6.3.7 2ed25bd4a@24111811 dev |
+ | Daemon | 6.3.7 744cba543@24112020 dev |
| Columnar | columnar 2.3.1 30ad2d6@24100914 |
| Secondary | secondary 2.3.1 30ad2d6@24100914 |
| KNN | knn 2.3.1 30ad2d6@24100914 |
| Buddy | buddy v3.0.1 |
+-----------+----------------------------------+
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | awk '!/row.*in set/'; echo
––– output –––
+-------+------+
| Table | Type |
+-------+------+
| t | rt |
+-------+------+
––– input –––
curl -s "http://localhost:9308/cli?select%20*%20from%20t%20where%20match('example')" | awk '!/row.*in set/'; echo
––– output –––
+----+---------+
| id | value |
+----+---------+
| 1 | example |
+----+---------+
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show version"; echo
––– output –––
- [{"total":5,"error":"","warning":"","columns":[{"Component":{"type":"string"}},{"Version":{"type":"string"}}],"data":[{"Component":"Daemon","Version":"6.3.7 2ed25bd4a@24111811 dev"},{"Component":"Columnar","Version":"columnar 2.3.1 30ad2d6@24100914"},{"Component":"Secondary","Version":"secondary 2.3.1 30ad2d6@24100914"},{"Component":"KNN","Version":"knn 2.3.1 30ad2d6@24100914"},{"Component":"Buddy","Version":"buddy v3.0.1"}]}]
+ [{"total":5,"error":"","warning":"","columns":[{"Component":{"type":"string"}},{"Version":{"type":"string"}}],"data":[{"Component":"Daemon","Version":"6.3.7 744cba543@24112020 dev"},{"Component":"Columnar","Version":"columnar 2.3.1 30ad2d6@24100914"},{"Component":"Secondary","Version":"secondary 2.3.1 30ad2d6@24100914"},{"Component":"KNN","Version":"knn 2.3.1 30ad2d6@24100914"},{"Component":"Buddy","Version":"buddy v3.0.1"}]}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
{"Table":"t","Type":"rt"}
],
"total":1,
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "select * from t where match('example')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
{"id":1,"value":"example"}
],
"total":1,
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql" -d "select * from t"; echo
––– output –––
{"took":%{NUMBER},"timed_out":false,"hits":{"total":2,"total_relation":"eq","hits":[{"_id":1,"_score":1,"_source":{"value":"example"}},{"_id":2,"_score":1,"_source":{"value":"test"}}]}}
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "select * from t"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
{"id":1,"value":"example"},
{"id":2,"value":"test"}
],
"total":2,
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
{"Table":"t","Type":"rt"}
],
"total":1,
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "select * from t where match('nonexistent')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
],
"total":0,
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "select * from t where match('nonexistent')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
],
"total":0,
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | sed '/row.*in set/d' | sed 's/ (.*sec)//'; echo
––– output –––
+-------+------+
| Table | Type |
+-------+------+
| t | rt |
+-------+------+
––– input –––
curl -s "http://localhost:9308/cli?describe%20t" | awk '!/row.*in set/'; echo
––– output –––
+-------+--------+----------------+
| Field | Type | Properties |
+-------+--------+----------------+
| id | bigint | |
| value | text | indexed stored |
+-------+--------+----------------+
––– input –––
curl -s "http://localhost:9308/cli_json" -d "DESCRIBE t"; echo
––– output –––
[{
"columns":[{"Field":{"type":"string"}},{"Type":{"type":"string"}},{"Properties":{"type":"string"}}],
"data":[
{"Field":"id","Type":"bigint","Properties":""},
{"Field":"value","Type":"text","Properties":"indexed stored"}
],
"total":2,
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?drop%20table%20t" | awk '!/Query OK/ && !/rows affected/'; echo
––– output –––
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
],
"total":0,
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | sed 's/ (.*sec)//'; echo
––– output –––
Empty set
––– input –––
curl -s "http://localhost:9308/cli_json" -d "SHOW STATUS"; echo
––– output –––
[{
"columns":[{"Counter":{"type":"string"}},{"Value":{"type":"string"}}],
"data":[
- {"Counter":"uptime","Value":"2"},
+ {"Counter":"uptime","Value":"0"},
- {"Counter":"connections","Value":"28"},
+ {"Counter":"connections","Value":"24"},
{"Counter":"maxed_out","Value":"0"},
- {"Counter":"version","Value":"6.3.7 2ed25bd4a@24111811 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914) (buddy v3.0.1)"},
+ {"Counter":"version","Value":"6.3.7 744cba543@24112020 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914) (buddy v3.0.1)"},
- {"Counter":"mysql_version","Value":"6.3.7 2ed25bd4a@24111811 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914)"},
+ {"Counter":"mysql_version","Value":"6.3.7 744cba543@24112020 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914)"},
- {"Counter":"command_search","Value":"6"},
+ {"Counter":"command_search","Value":"5"},
{"Counter":"command_excerpt","Value":"0"},
{"Counter":"command_update","Value":"0"},
{"Counter":"command_keywords","Value":"0"},
{"Counter":"command_persist","Value":"0"},
{"Counter":"command_status","Value":"3"},
{"Counter":"command_flushattrs","Value":"0"},
{"Counter":"command_sphinxql","Value":"0"},
{"Counter":"command_ping","Value":"0"},
{"Counter":"command_delete","Value":"0"},
{"Counter":"command_set","Value":"0"},
{"Counter":"command_insert","Value":"1"},
{"Counter":"command_replace","Value":"0"},
{"Counter":"command_commit","Value":"0"},
{"Counter":"command_suggest","Value":"0"},
{"Counter":"command_json","Value":"0"},
{"Counter":"command_callpq","Value":"0"},
{"Counter":"command_cluster","Value":"0"},
{"Counter":"command_getfield","Value":"0"},
{"Counter":"insert_replace_stats_ms_avg","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_min","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_max","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_pct95","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_pct99","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_avg","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_min","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_max","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_pct95","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_pct99","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"update_stats_ms_avg","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_min","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_max","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_pct95","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_pct99","Value":"N/A N/A N/A"},
{"Counter":"agent_connect","Value":"0"},
{"Counter":"agent_tfo","Value":"0"},
{"Counter":"agent_retry","Value":"0"},
{"Counter":"queries","Value":"6"},
{"Counter":"dist_queries","Value":"0"},
- {"Counter":"workers_total","Value":"8"},
+ {"Counter":"workers_total","Value":"4"},
{"Counter":"workers_active","Value":"4"},
{"Counter":"workers_clients","Value":"2"},
{"Counter":"workers_clients_vip","Value":"0"},
{"Counter":"workers_clients_buddy","Value":"1"},
{"Counter":"work_queue_length","Value":"6"},
{"Counter":"load","Value":"0.00 0.00 0.00"},
{"Counter":"load_primary","Value":"0.00 0.00 0.00"},
{"Counter":"load_secondary","Value":"0.00 0.00 0.00"},
{"Counter":"query_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"query_cpu","Value":"OFF"},
{"Counter":"dist_wall","Value":"0.000"},
{"Counter":"dist_local","Value":"0.000"},
{"Counter":"dist_wait","Value":"0.000"},
{"Counter":"query_reads","Value":"OFF"},
{"Counter":"query_readkb","Value":"OFF"},
{"Counter":"query_readtime","Value":"OFF"},
- {"Counter":"avg_query_wall","Value":"0.001"},
+ {"Counter":"avg_query_wall","Value":"0.000"},
{"Counter":"avg_query_cpu","Value":"OFF"},
{"Counter":"avg_dist_wall","Value":"0.000"},
{"Counter":"avg_dist_local","Value":"0.000"},
{"Counter":"avg_dist_wait","Value":"0.000"},
{"Counter":"avg_query_reads","Value":"OFF"},
{"Counter":"avg_query_readkb","Value":"OFF"},
{"Counter":"avg_query_readtime","Value":"OFF"},
{"Counter":"qcache_max_bytes","Value":"16777216"},
{"Counter":"qcache_thresh_msec","Value":"3000"},
{"Counter":"qcache_ttl_sec","Value":"60"},
{"Counter":"qcache_cached_queries","Value":"0"},
{"Counter":"qcache_used_bytes","Value":"0"},
{"Counter":"qcache_hits","Value":"0"}
],
"total":75,
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20status" | awk '!/row.*in set/'; echo
––– output –––
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| Counter | Value |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | uptime | 2 |
+ | uptime | 0 |
- | connections | 29 |
+ | connections | 25 |
| maxed_out | 0 |
- | version | 6.3.7 2ed25bd4a@24111811 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914) (buddy v3.0.1) |
+ | version | 6.3.7 744cba543@24112020 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914) (buddy v3.0.1) |
- | mysql_version | 6.3.7 2ed25bd4a@24111811 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914) |
+ | mysql_version | 6.3.7 744cba543@24112020 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914) |
- | command_search | 6 |
+ | command_search | 5 |
| command_excerpt | 0 |
| command_update | 0 |
| command_keywords | 0 |
| command_persist | 0 |
| command_status | 4 |
| command_flushattrs | 0 |
| command_sphinxql | 0 |
| command_ping | 0 |
| command_delete | 0 |
| command_set | 0 |
| command_insert | 1 |
| command_replace | 0 |
| command_commit | 0 |
| command_suggest | 0 |
| command_json | 0 |
| command_callpq | 0 |
| command_cluster | 0 |
| command_getfield | 0 |
| insert_replace_stats_ms_avg | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_min | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_max | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_pct95 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_pct99 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_avg | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_min | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_max | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_pct95 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_pct99 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| update_stats_ms_avg | N/A N/A N/A |
| update_stats_ms_min | N/A N/A N/A |
| update_stats_ms_max | N/A N/A N/A |
| update_stats_ms_pct95 | N/A N/A N/A |
| update_stats_ms_pct99 | N/A N/A N/A |
| agent_connect | 0 |
| agent_tfo | 0 |
| agent_retry | 0 |
| queries | 6 |
| dist_queries | 0 |
- | workers_total | 8 |
+ | workers_total | 4 |
| workers_active | 4 |
| workers_clients | 2 |
| workers_clients_vip | 0 |
| workers_clients_buddy | 1 |
| work_queue_length | 6 |
| load | 0.00 0.00 0.00 |
| load_primary | 0.00 0.00 0.00 |
| load_secondary | 0.00 0.00 0.00 |
| query_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| query_cpu | OFF |
| dist_wall | 0.000 |
| dist_local | 0.000 |
| dist_wait | 0.000 |
| query_reads | OFF |
| query_readkb | OFF |
| query_readtime | OFF |
| avg_query_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_query_cpu | OFF |
| avg_dist_wall | 0.000 |
| avg_dist_local | 0.000 |
| avg_dist_wait | 0.000 |
| avg_query_reads | OFF |
| avg_query_readkb | OFF |
| avg_query_readtime | OFF |
| qcache_max_bytes | 16777216 |
| qcache_thresh_msec | 3000 |
| qcache_ttl_sec | 60 |
| qcache_cached_queries | 0 |
| qcache_used_bytes | 0 |
| qcache_hits | 0 |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE big_table (id INT, value TEXT);"
––– output –––
––– input –––
for i in $(seq 1 1000000); do echo "INSERT INTO big_table VALUES ($i, 'value_$i');"; done | mysql -h0 -P9306
––– output –––
––– input –––
curl -s "http://localhost:9308/cli?select%20*%20from%20big_table%20limit%2010" | awk '!/row.*in set/'; echo
––– output –––
+--------+--------------+
| id | value |
+--------+--------------+
| 939142 | value_939142 |
| 418023 | value_418023 |
| 418022 | value_418022 |
| 939140 | value_939140 |
| 418021 | value_418021 |
| 939141 | value_939141 |
| 418020 | value_418020 |
| 939138 | value_939138 |
| 939139 | value_939139 |
| 418019 | value_418019 |
+--------+--------------+
––– input –––
curl -s "http://localhost:9308/cli?select%20count(*)%20as%20total%20from%20big_table" | awk '!/row.*in set/'; echo
––– output –––
+---------+
| total |
+---------+
| 1000000 |
+---------+
––– input –––
curl -s "http://localhost:9308/cli?drop%20table%20big_table" | awk '!/Query OK/ && !/rows affected/'; echo
––– output –––
––– input –––
curl -X POST "http://localhost:9308/sql" -d "EXPLAIN FORMAT=json SELECT * FROM t WHERE MATCH('example')"; echo
––– output –––
{"error":"P01: syntax error, unexpected '=' near '=json SELECT * FROM t WHERE MATCH('example')'"}
|
clt👎 CLT tests in test/clt-tests/core/show-version-http.rec––– 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 t (id INT, value TEXT); INSERT INTO t VALUES (1, 'example'), (2, 'test');"
––– output –––
––– input –––
curl -s "http://localhost:9308/cli?show%20version" | awk '!/row.*in set/'; echo
––– output –––
+-----------+----------------------------------+
| Component | Version |
+-----------+----------------------------------+
| Daemon | %{SEMVER} %{COMMITDATE} dev |
| Columnar | columnar %{SEMVER} %{COMMITDATE} |
| Secondary | secondary %{SEMVER} %{COMMITDATE} |
| KNN | knn %{SEMVER} %{COMMITDATE} |
| Buddy | buddy v%{SEMVER} |
+-----------+----------------------------------+
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | awk '!/row.*in set/'; echo
––– output –––
+-------+------+
| Table | Type |
+-------+------+
| t | rt |
+-------+------+
––– input –––
curl -s "http://localhost:9308/cli?select%20*%20from%20t%20where%20match('example')" | awk '!/row.*in set/'; echo
––– output –––
+----+---------+
| id | value |
+----+---------+
| 1 | example |
+----+---------+
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show version"; echo
––– output –––
[{"total":5,"error":"","warning":"","columns":[{"Component":{"type":"string"}},{"Version":{"type":"string"}}],"data":[{"Component":"Daemon","Version":"%{SEMVER} %{COMMITDATE} dev"},{"Component":"Columnar","Version":"columnar %{SEMVER} %{COMMITDATE}"},{"Component":"Secondary","Version":"secondary %{SEMVER} %{COMMITDATE}"},{"Component":"KNN","Version":"knn %{SEMVER} %{COMMITDATE}"},{"Component":"Buddy","Version":"buddy v%{SEMVER}"}]}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
{"Table":"t","Type":"rt"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "select * from t where match('example')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
{"id":1,"value":"example"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql" -d "select * from t"; echo
––– output –––
{"took":%{NUMBER},"timed_out":false,"hits":{"total":2,"total_relation":"eq","hits":[{"_id":1,"_score":1,"_source":{"value":"example"}},{"_id":2,"_score":1,"_source":{"value":"test"}}]}}
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "select * from t"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
{"id":1,"value":"example"},
{"id":2,"value":"test"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
{"Table":"t","Type":"rt"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "select * from t where match('nonexistent')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "select * from t where match('nonexistent')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | sed '/row.*in set/d' | sed 's/ (.*sec)//'; echo
––– output –––
+-------+------+
| Table | Type |
+-------+------+
| t | rt |
+-------+------+
––– input –––
curl -s "http://localhost:9308/cli?describe%20t" | awk '!/row.*in set/'; echo
––– output –––
+-------+--------+----------------+
| Field | Type | Properties |
+-------+--------+----------------+
| id | bigint | |
| value | text | indexed stored |
+-------+--------+----------------+
––– input –––
curl -s "http://localhost:9308/cli_json" -d "DESCRIBE t"; echo
––– output –––
[{
"columns":[{"Field":{"type":"string"}},{"Type":{"type":"string"}},{"Properties":{"type":"string"}}],
"data":[
{"Field":"id","Type":"bigint","Properties":""},
{"Field":"value","Type":"text","Properties":"indexed stored"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?drop%20table%20t" | awk '!/Query OK/ && !/rows affected/'; echo
––– output –––
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | sed 's/ (.*sec)//'; echo
––– output –––
Empty set
––– input –––
curl -s "http://localhost:9308/cli_json" -d "SHOW STATUS"; echo
––– output –––
[{
"columns":[{"Counter":{"type":"string"}},{"Value":{"type":"string"}}],
"data":[
- {"Counter":"uptime","Value":"2"},
+ {"Counter":"uptime","Value":"0"},
- {"Counter":"connections","Value":"28"},
+ {"Counter":"connections","Value":"24"},
{"Counter":"maxed_out","Value":"0"},
{"Counter":"version","Value":"%{SEMVER} %{COMMITDATE} dev (columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE}) (buddy v%{SEMVER})"},
{"Counter":"mysql_version","Value":"%{SEMVER} %{COMMITDATE} dev (columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE})"},
- {"Counter":"command_search","Value":"6"},
+ {"Counter":"command_search","Value":"5"},
{"Counter":"command_excerpt","Value":"0"},
{"Counter":"command_update","Value":"0"},
{"Counter":"command_keywords","Value":"0"},
{"Counter":"command_persist","Value":"0"},
{"Counter":"command_status","Value":"3"},
{"Counter":"command_flushattrs","Value":"0"},
{"Counter":"command_sphinxql","Value":"0"},
{"Counter":"command_ping","Value":"0"},
{"Counter":"command_delete","Value":"0"},
{"Counter":"command_set","Value":"0"},
{"Counter":"command_insert","Value":"1"},
{"Counter":"command_replace","Value":"0"},
{"Counter":"command_commit","Value":"0"},
{"Counter":"command_suggest","Value":"0"},
{"Counter":"command_json","Value":"0"},
{"Counter":"command_callpq","Value":"0"},
{"Counter":"command_cluster","Value":"0"},
{"Counter":"command_getfield","Value":"0"},
{"Counter":"insert_replace_stats_ms_avg","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_min","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_max","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_pct95","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_pct99","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_avg","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_min","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_max","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_pct95","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_pct99","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"update_stats_ms_avg","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_min","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_max","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_pct95","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_pct99","Value":"N/A N/A N/A"},
{"Counter":"agent_connect","Value":"0"},
{"Counter":"agent_tfo","Value":"0"},
{"Counter":"agent_retry","Value":"0"},
{"Counter":"queries","Value":"6"},
{"Counter":"dist_queries","Value":"0"},
- {"Counter":"workers_total","Value":"8"},
+ {"Counter":"workers_total","Value":"4"},
{"Counter":"workers_active","Value":"4"},
{"Counter":"workers_clients","Value":"2"},
{"Counter":"workers_clients_vip","Value":"0"},
{"Counter":"workers_clients_buddy","Value":"1"},
{"Counter":"work_queue_length","Value":"6"},
{"Counter":"load","Value":"0.00 0.00 0.00"},
{"Counter":"load_primary","Value":"0.00 0.00 0.00"},
{"Counter":"load_secondary","Value":"0.00 0.00 0.00"},
{"Counter":"query_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"query_cpu","Value":"OFF"},
{"Counter":"dist_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"dist_local","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"dist_wait","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"query_reads","Value":"OFF"},
{"Counter":"query_readkb","Value":"OFF"},
{"Counter":"query_readtime","Value":"OFF"},
- {"Counter":"avg_query_wall","Value":"0.001"},
+ {"Counter":"avg_query_wall","Value":"0.000"},
{"Counter":"avg_query_cpu","Value":"OFF"},
{"Counter":"avg_dist_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"avg_dist_local","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"avg_dist_wait","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"avg_query_reads","Value":"OFF"},
{"Counter":"avg_query_readkb","Value":"OFF"},
{"Counter":"avg_query_readtime","Value":"OFF"},
{"Counter":"qcache_max_bytes","Value":"16777216"},
{"Counter":"qcache_thresh_msec","Value":"3000"},
{"Counter":"qcache_ttl_sec","Value":"60"},
{"Counter":"qcache_cached_queries","Value":"0"},
{"Counter":"qcache_used_bytes","Value":"0"},
{"Counter":"qcache_hits","Value":"0"}
],
"total":75,
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20status" | awk '!/row.*in set/'; echo
––– output –––
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| Counter | Value |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | uptime | 2 |
+ | uptime | 0 |
- | connections | 29 |
+ | connections | 25 |
| maxed_out | 0 |
| version | %{SEMVER} %{COMMITDATE} dev (columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE}) (buddy v%{SEMVER}) |
| mysql_version | %{SEMVER} %{COMMITDATE} dev (columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE}) |
- | command_search | 6 |
+ | command_search | 5 |
| command_excerpt | 0 |
| command_update | 0 |
| command_keywords | 0 |
| command_persist | 0 |
| command_status | 4 |
| command_flushattrs | 0 |
| command_sphinxql | 0 |
| command_ping | 0 |
| command_delete | 0 |
| command_set | 0 |
| command_insert | 1 |
| command_replace | 0 |
| command_commit | 0 |
| command_suggest | 0 |
| command_json | 0 |
| command_callpq | 0 |
| command_cluster | 0 |
| command_getfield | 0 |
| insert_replace_stats_ms_avg | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_min | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_max | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_pct95 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_pct99 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_avg | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_min | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_max | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_pct95 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_pct99 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| update_stats_ms_avg | N/A N/A N/A |
| update_stats_ms_min | N/A N/A N/A |
| update_stats_ms_max | N/A N/A N/A |
| update_stats_ms_pct95 | N/A N/A N/A |
| update_stats_ms_pct99 | N/A N/A N/A |
| agent_connect | 0 |
| agent_tfo | 0 |
| agent_retry | 0 |
| queries | 6 |
| dist_queries | 0 |
- | workers_total | 8 |
+ | workers_total | 4 |
| workers_active | 4 |
| workers_clients | 2 |
| workers_clients_vip | 0 |
| workers_clients_buddy | 1 |
| work_queue_length | 6 |
| load | 0.00 0.00 0.00 |
| load_primary | 0.00 0.00 0.00 |
| load_secondary | 0.00 0.00 0.00 |
| query_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| query_cpu | OFF |
| dist_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| dist_local | #!/[0-9]{1}.[0-9]{3}/!# |
| dist_wait | #!/[0-9]{1}.[0-9]{3}/!# |
| query_reads | OFF |
| query_readkb | OFF |
| query_readtime | OFF |
| avg_query_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_query_cpu | OFF |
| avg_dist_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_dist_local | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_dist_wait | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_query_reads | OFF |
| avg_query_readkb | OFF |
| avg_query_readtime | OFF |
| qcache_max_bytes | 16777216 |
| qcache_thresh_msec | 3000 |
| qcache_ttl_sec | 60 |
| qcache_cached_queries | 0 |
| qcache_used_bytes | 0 |
| qcache_hits | 0 |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE big_table (id INT, value TEXT);"
––– output –––
––– input –––
for i in $(seq 1 1000000); do echo "INSERT INTO big_table VALUES ($i, 'value_$i');"; done | mysql -h0 -P9306
––– output –––
––– input –––
curl -s "http://localhost:9308/cli?select%20*%20from%20big_table%20limit%2010" | awk '!/row.*in set/'; echo
––– output –––
+--------+--------------+
| id | value |
+--------+--------------+
| 939142 | value_939142 |
| 418023 | value_418023 |
| 418022 | value_418022 |
| 939140 | value_939140 |
| 418021 | value_418021 |
| 939141 | value_939141 |
| 418020 | value_418020 |
| 939138 | value_939138 |
| 939139 | value_939139 |
| 418019 | value_418019 |
+--------+--------------+
––– input –––
curl -s "http://localhost:9308/cli?select%20count(*)%20as%20total%20from%20big_table" | awk '!/row.*in set/'; echo
––– output –––
+---------+
| total |
+---------+
| 1000000 |
+---------+
––– input –––
curl -s "http://localhost:9308/cli?drop%20table%20big_table" | awk '!/Query OK/ && !/rows affected/'; echo
––– output –––
––– input –––
curl -X POST "http://localhost:9308/sql" -d "EXPLAIN FORMAT=json SELECT * FROM t WHERE MATCH('example')"; echo
––– output –––
{"error":"P01: syntax error, unexpected '=' near '=json SELECT * FROM t WHERE MATCH('example')'"}
|
clt👎 CLT tests in test/clt-tests/core/show-version-http.rec––– 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 t (id INT, value TEXT); INSERT INTO t VALUES (1, 'example'), (2, 'test');"
––– output –––
––– input –––
curl -s "http://localhost:9308/cli?show%20version" | awk '!/row.*in set/'; echo
––– output –––
+-----------+----------------------------------+
| Component | Version |
+-----------+----------------------------------+
| Daemon | %{SEMVER} %{COMMITDATE} dev |
| Columnar | columnar %{SEMVER} %{COMMITDATE} |
| Secondary | secondary %{SEMVER} %{COMMITDATE} |
| KNN | knn %{SEMVER} %{COMMITDATE} |
| Buddy | buddy v%{SEMVER} |
+-----------+----------------------------------+
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | awk '!/row.*in set/'; echo
––– output –––
+-------+------+
| Table | Type |
+-------+------+
| t | rt |
+-------+------+
––– input –––
curl -s "http://localhost:9308/cli?select%20*%20from%20t%20where%20match('example')" | awk '!/row.*in set/'; echo
––– output –––
+----+---------+
| id | value |
+----+---------+
| 1 | example |
+----+---------+
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show version"; echo
––– output –––
[{"total":5,"error":"","warning":"","columns":[{"Component":{"type":"string"}},{"Version":{"type":"string"}}],"data":[{"Component":"Daemon","Version":"%{SEMVER} %{COMMITDATE} dev"},{"Component":"Columnar","Version":"columnar %{SEMVER} %{COMMITDATE}"},{"Component":"Secondary","Version":"secondary %{SEMVER} %{COMMITDATE}"},{"Component":"KNN","Version":"knn %{SEMVER} %{COMMITDATE}"},{"Component":"Buddy","Version":"buddy v%{SEMVER}"}]}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
{"Table":"t","Type":"rt"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "select * from t where match('example')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
{"id":1,"value":"example"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql" -d "select * from t"; echo
––– output –––
{"took":%{NUMBER},"timed_out":false,"hits":{"total":2,"total_relation":"eq","hits":[{"_id":1,"_score":1,"_source":{"value":"example"}},{"_id":2,"_score":1,"_source":{"value":"test"}}]}}
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "select * from t"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
{"id":1,"value":"example"},
{"id":2,"value":"test"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
{"Table":"t","Type":"rt"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "select * from t where match('nonexistent')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "select * from t where match('nonexistent')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | sed '/row.*in set/d' | sed 's/ (.*sec)//'; echo
––– output –––
+-------+------+
| Table | Type |
+-------+------+
| t | rt |
+-------+------+
––– input –––
curl -s "http://localhost:9308/cli?describe%20t" | awk '!/row.*in set/'; echo
––– output –––
+-------+--------+----------------+
| Field | Type | Properties |
+-------+--------+----------------+
| id | bigint | |
| value | text | indexed stored |
+-------+--------+----------------+
––– input –––
curl -s "http://localhost:9308/cli_json" -d "DESCRIBE t"; echo
––– output –––
[{
"columns":[{"Field":{"type":"string"}},{"Type":{"type":"string"}},{"Properties":{"type":"string"}}],
"data":[
{"Field":"id","Type":"bigint","Properties":""},
{"Field":"value","Type":"text","Properties":"indexed stored"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?drop%20table%20t" | awk '!/Query OK/ && !/rows affected/'; echo
––– output –––
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | sed 's/ (.*sec)//'; echo
––– output –––
Empty set
––– input –––
curl -s "http://localhost:9308/cli_json" -d "SHOW STATUS"; echo
––– output –––
[{
"columns":[{"Counter":{"type":"string"}},{"Value":{"type":"string"}}],
"data":[
{"Counter":"uptime","Value":"%{NUMBER}"},
{"Counter":"connections","Value":"%{NUMBER}"},
{"Counter":"maxed_out","Value":"%{NUMBER}"},
{"Counter":"version","Value":"%{SEMVER} %{COMMITDATE} dev (columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE}) (buddy v%{SEMVER})"},
{"Counter":"mysql_version","Value":"%{SEMVER} %{COMMITDATE} dev (columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE})"},
{"Counter":"command_search","Value":"%{NUMBER}"},
{"Counter":"command_excerpt","Value":"%{NUMBER}"},
{"Counter":"command_update","Value":"%{NUMBER}"},
{"Counter":"command_keywords","Value":"%{NUMBER}"},
{"Counter":"command_persist","Value":"%{NUMBER}"},
{"Counter":"command_status","Value":"%{NUMBER}"},
- {"Counter":"command_flushattrs","Value":"V"},
+ {"Counter":"command_flushattrs","Value":"0"},
{"Counter":"command_sphinxql","Value":"%{NUMBER}"},
{"Counter":"command_ping","Value":"%{NUMBER}"},
{"Counter":"command_delete","Value":"%{NUMBER}"},
{"Counter":"command_set","Value":"%{NUMBER}"},
{"Counter":"command_insert","Value":"%{NUMBER}"},
{"Counter":"command_replace","Value":"%{NUMBER}"},
{"Counter":"command_commit","Value":"%{NUMBER}"},
{"Counter":"command_suggest","Value":"%{NUMBER}"},
{"Counter":"command_json","Value":"%{NUMBER}"},
{"Counter":"command_callpq","Value":"%{NUMBER}"},
{"Counter":"command_cluster","Value":"%{NUMBER}"},
{"Counter":"command_getfield","Value":"%{NUMBER}"},
{"Counter":"insert_replace_stats_ms_avg","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_min","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_max","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_pct95","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_pct99","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_avg","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_min","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_max","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_pct95","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_pct99","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"update_stats_ms_avg","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_min","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_max","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_pct95","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_pct99","Value":"N/A N/A N/A"},
{"Counter":"agent_connect","Value":"%{NUMBER}"},
{"Counter":"agent_tfo","Value":"%{NUMBER}"},
{"Counter":"agent_retry","Value":"%{NUMBER}"},
{"Counter":"queries","Value":"%{NUMBER}"},
{"Counter":"dist_queries","Value":"%{NUMBER}"},
{"Counter":"workers_total","Value":"%{NUMBER}"},
{"Counter":"workers_active","Value":"%{NUMBER}"},
{"Counter":"workers_clients","Value":"%{NUMBER}"},
{"Counter":"workers_clients_vip","Value":"%{NUMBER}"},
{"Counter":"workers_clients_buddy","Value":"%{NUMBER}"},
{"Counter":"work_queue_length","Value":"6"},
{"Counter":"load","Value":"0.00 0.00 0.00"},
{"Counter":"load_primary","Value":"0.00 0.00 0.00"},
{"Counter":"load_secondary","Value":"0.00 0.00 0.00"},
{"Counter":"query_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"query_cpu","Value":"OFF"},
{"Counter":"dist_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"dist_local","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"dist_wait","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"query_reads","Value":"OFF"},
{"Counter":"query_readkb","Value":"OFF"},
{"Counter":"query_readtime","Value":"OFF"},
{"Counter":"avg_query_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"avg_query_cpu","Value":"OFF"},
{"Counter":"avg_dist_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"avg_dist_local","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"avg_dist_wait","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"avg_query_reads","Value":"OFF"},
{"Counter":"avg_query_readkb","Value":"OFF"},
{"Counter":"avg_query_readtime","Value":"OFF"},
{"Counter":"qcache_max_bytes","Value":"%{NUMBER}"},
{"Counter":"qcache_thresh_msec","Value":"%{NUMBER}"},
{"Counter":"qcache_ttl_sec","Value":"%{NUMBER}"},
{"Counter":"qcache_cached_queries","Value":"%{NUMBER}"},
{"Counter":"qcache_used_bytes","Value":"%{NUMBER}"},
{"Counter":"qcache_hits","Value":"0"}
],
"total":75,
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20status" | awk '!/row.*in set/'; echo
––– output –––
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| Counter | Value |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| uptime | %{NUMBER} |
| connections | %{NUMBER} |
| maxed_out | %{NUMBER} |
| version | %{SEMVER} %{COMMITDATE} dev (columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE}) (buddy v%{SEMVER}) |
| mysql_version | %{SEMVER} %{COMMITDATE} dev (columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE}) |
| command_search | %{NUMBER} |
| command_excerpt | 0 |
| command_update | 0 |
| command_keywords | 0 |
| command_persist | 0 |
| command_status | %{NUMBER} |
| command_flushattrs | 0 |
| command_sphinxql | 0 |
| command_ping | 0 |
| command_delete | 0 |
| command_set | 0 |
| command_insert | %{NUMBER} |
| command_replace | 0 |
| command_commit | 0 |
| command_suggest | 0 |
| command_json | 0 |
| command_callpq | 0 |
| command_cluster | 0 |
| command_getfield | 0 |
| insert_replace_stats_ms_avg | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_min | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_max | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_pct95 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_pct99 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_avg | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_min | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_max | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_pct95 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_pct99 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| update_stats_ms_avg | N/A N/A N/A |
| update_stats_ms_min | N/A N/A N/A |
| update_stats_ms_max | N/A N/A N/A |
| update_stats_ms_pct95 | N/A N/A N/A |
| update_stats_ms_pct99 | N/A N/A N/A |
| agent_connect | 0 |
| agent_tfo | 0 |
| agent_retry | 0 |
| queries | %{NUMBER} |
| dist_queries | 0 |
| workers_total | %{NUMBER} |
| workers_active | %{NUMBER} |
| workers_clients | %{NUMBER} |
| workers_clients_vip | 0 |
| workers_clients_buddy | %{NUMBER} |
| work_queue_length | 6 |
| load | 0.00 0.00 0.00 |
| load_primary | 0.00 0.00 0.00 |
| load_secondary | 0.00 0.00 0.00 |
| query_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| query_cpu | OFF |
| dist_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| dist_local | #!/[0-9]{1}.[0-9]{3}/!# |
| dist_wait | #!/[0-9]{1}.[0-9]{3}/!# |
| query_reads | OFF |
| query_readkb | OFF |
| query_readtime | OFF |
| avg_query_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_query_cpu | OFF |
| avg_dist_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_dist_local | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_dist_wait | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_query_reads | OFF |
| avg_query_readkb | OFF |
| avg_query_readtime | OFF |
| qcache_max_bytes | 16777216 |
| qcache_thresh_msec | 3000 |
| qcache_ttl_sec | 60 |
| qcache_cached_queries | 0 |
| qcache_used_bytes | 0 |
| qcache_hits | 0 |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE big_table (id INT, value TEXT);"
––– output –––
––– input –––
for i in $(seq 1 1000000); do echo "INSERT INTO big_table VALUES ($i, 'value_$i');"; done | mysql -h0 -P9306
––– output –––
––– input –––
curl -s "http://localhost:9308/cli?select%20*%20from%20big_table%20limit%2010" | awk '!/row.*in set/'; echo
––– output –––
+--------+--------------+
| id | value |
+--------+--------------+
| 939142 | value_939142 |
| 418023 | value_418023 |
| 418022 | value_418022 |
| 939140 | value_939140 |
| 418021 | value_418021 |
| 939141 | value_939141 |
| 418020 | value_418020 |
| 939138 | value_939138 |
| 939139 | value_939139 |
| 418019 | value_418019 |
+--------+--------------+
––– input –––
curl -s "http://localhost:9308/cli?select%20count(*)%20as%20total%20from%20big_table" | awk '!/row.*in set/'; echo
––– output –––
+---------+
| total |
+---------+
| 1000000 |
+---------+
––– input –––
curl -s "http://localhost:9308/cli?drop%20table%20big_table" | awk '!/Query OK/ && !/rows affected/'; echo
––– output –––
––– input –––
curl -X POST "http://localhost:9308/sql" -d "EXPLAIN FORMAT=json SELECT * FROM t WHERE MATCH('example')"; echo
––– output –––
{"error":"P01: syntax error, unexpected '=' near '=json SELECT * FROM t WHERE MATCH('example')'"}
|
clt👎 CLT tests in test/clt-tests/core/show-version-http.rec––– 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 t (id INT, value TEXT); INSERT INTO t VALUES (1, 'example'), (2, 'test');"
––– output –––
––– input –––
curl -s "http://localhost:9308/cli?show%20version" | awk '!/row.*in set/'; echo
––– output –––
- +-----------+----------------------------------+
+ [{"total":5,"error":"","warning":"","columns":[{"Component":{"type":"string"}},{"Version":{"type":"string"}}],"data":[{"Component":"Daemon","Version":"6.3.9 eeb69debe@24112423 dev"},{"Component":"Columnar","Version":"columnar 2.3.1 edadc69@24112219"},{"Component":"Secondary","Version":"secondary 2.3.1 edadc69@24112219"},{"Component":"KNN","Version":"knn 2.3.1 edadc69@24112219"},{"Component":"Buddy","Version":"buddy v3.0.1"}]}]
- | Component | Version |
- +-----------+----------------------------------+
- | Daemon | %{SEMVER} %{COMMITDATE} dev |
- | Columnar | columnar %{SEMVER} %{COMMITDATE} |
- | Secondary | secondary %{SEMVER} %{COMMITDATE} |
- | KNN | knn %{SEMVER} %{COMMITDATE} |
- | Buddy | buddy v%{SEMVER} |
- +-----------+----------------------------------+
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | awk '!/row.*in set/'; echo
––– output –––
+-------+------+
| Table | Type |
+-------+------+
| t | rt |
+-------+------+
––– input –––
curl -s "http://localhost:9308/cli?select%20*%20from%20t%20where%20match('example')" | awk '!/row.*in set/'; echo
––– output –––
+----+---------+
| id | value |
+----+---------+
| 1 | example |
+----+---------+
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show version"; echo
––– output –––
[{"total":5,"error":"","warning":"","columns":[{"Component":{"type":"string"}},{"Version":{"type":"string"}}],"data":[{"Component":"Daemon","Version":"%{SEMVER} %{COMMITDATE} dev"},{"Component":"Columnar","Version":"columnar %{SEMVER} %{COMMITDATE}"},{"Component":"Secondary","Version":"secondary %{SEMVER} %{COMMITDATE}"},{"Component":"KNN","Version":"knn %{SEMVER} %{COMMITDATE}"},{"Component":"Buddy","Version":"buddy v%{SEMVER}"}]}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
{"Table":"t","Type":"rt"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "select * from t where match('example')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
{"id":1,"value":"example"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql" -d "select * from t"; echo
––– output –––
{"took":%{NUMBER},"timed_out":false,"hits":{"total":2,"total_relation":"eq","hits":[{"_id":1,"_score":1,"_source":{"value":"example"}},{"_id":2,"_score":1,"_source":{"value":"test"}}]}}
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "select * from t"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
{"id":1,"value":"example"},
{"id":2,"value":"test"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
{"Table":"t","Type":"rt"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "select * from t where match('nonexistent')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "select * from t where match('nonexistent')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | sed '/row.*in set/d' | sed 's/ (.*sec)//'; echo
––– output –––
+-------+------+
| Table | Type |
+-------+------+
| t | rt |
+-------+------+
––– input –––
curl -s "http://localhost:9308/cli?describe%20t" | awk '!/row.*in set/'; echo
––– output –––
+-------+--------+----------------+
| Field | Type | Properties |
+-------+--------+----------------+
| id | bigint | |
| value | text | indexed stored |
+-------+--------+----------------+
––– input –––
curl -s "http://localhost:9308/cli_json" -d "DESCRIBE t"; echo
––– output –––
[{
"columns":[{"Field":{"type":"string"}},{"Type":{"type":"string"}},{"Properties":{"type":"string"}}],
"data":[
{"Field":"id","Type":"bigint","Properties":""},
{"Field":"value","Type":"text","Properties":"indexed stored"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?drop%20table%20t" | awk '!/Query OK/ && !/rows affected/'; echo
––– output –––
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | sed 's/ (.*sec)//'; echo
––– output –––
Empty set
––– input –––
curl -s "http://localhost:9308/cli_json" -d "SHOW STATUS"; echo
––– output –––
[{
"columns":[{"Counter":{"type":"string"}},{"Value":{"type":"string"}}],
"data":[
{"Counter":"uptime","Value":"%{NUMBER}"},
{"Counter":"connections","Value":"%{NUMBER}"},
{"Counter":"maxed_out","Value":"%{NUMBER}"},
{"Counter":"version","Value":"%{SEMVER} %{COMMITDATE} dev (columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE}) (buddy v%{SEMVER})"},
{"Counter":"mysql_version","Value":"%{SEMVER} %{COMMITDATE} dev (columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE})"},
{"Counter":"command_search","Value":"%{NUMBER}"},
{"Counter":"command_excerpt","Value":"%{NUMBER}"},
{"Counter":"command_update","Value":"%{NUMBER}"},
{"Counter":"command_keywords","Value":"%{NUMBER}"},
{"Counter":"command_persist","Value":"%{NUMBER}"},
{"Counter":"command_status","Value":"%{NUMBER}"},
{"Counter":"command_flushattrs","Value":"%{NUMBER}"},
{"Counter":"command_sphinxql","Value":"%{NUMBER}"},
{"Counter":"command_ping","Value":"%{NUMBER}"},
{"Counter":"command_delete","Value":"%{NUMBER}"},
{"Counter":"command_set","Value":"%{NUMBER}"},
{"Counter":"command_insert","Value":"%{NUMBER}"},
{"Counter":"command_replace","Value":"%{NUMBER}"},
{"Counter":"command_commit","Value":"%{NUMBER}"},
{"Counter":"command_suggest","Value":"%{NUMBER}"},
{"Counter":"command_json","Value":"%{NUMBER}"},
{"Counter":"command_callpq","Value":"%{NUMBER}"},
{"Counter":"command_cluster","Value":"%{NUMBER}"},
{"Counter":"command_getfield","Value":"%{NUMBER}"},
{"Counter":"insert_replace_stats_ms_avg","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_min","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_max","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_pct95","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_pct99","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_avg","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_min","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_max","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_pct95","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_pct99","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"update_stats_ms_avg","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_min","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_max","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_pct95","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_pct99","Value":"N/A N/A N/A"},
{"Counter":"agent_connect","Value":"%{NUMBER}"},
{"Counter":"agent_tfo","Value":"%{NUMBER}"},
{"Counter":"agent_retry","Value":"%{NUMBER}"},
{"Counter":"queries","Value":"%{NUMBER}"},
{"Counter":"dist_queries","Value":"%{NUMBER}"},
{"Counter":"workers_total","Value":"%{NUMBER}"},
{"Counter":"workers_active","Value":"%{NUMBER}"},
{"Counter":"workers_clients","Value":"%{NUMBER}"},
{"Counter":"workers_clients_vip","Value":"%{NUMBER}"},
{"Counter":"workers_clients_buddy","Value":"%{NUMBER}"},
{"Counter":"work_queue_length","Value":"6"},
{"Counter":"load","Value":"0.00 0.00 0.00"},
{"Counter":"load_primary","Value":"0.00 0.00 0.00"},
{"Counter":"load_secondary","Value":"0.00 0.00 0.00"},
{"Counter":"query_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"query_cpu","Value":"OFF"},
{"Counter":"dist_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"dist_local","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"dist_wait","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"query_reads","Value":"OFF"},
{"Counter":"query_readkb","Value":"OFF"},
{"Counter":"query_readtime","Value":"OFF"},
{"Counter":"avg_query_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"avg_query_cpu","Value":"OFF"},
{"Counter":"avg_dist_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"avg_dist_local","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"avg_dist_wait","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"avg_query_reads","Value":"OFF"},
{"Counter":"avg_query_readkb","Value":"OFF"},
{"Counter":"avg_query_readtime","Value":"OFF"},
{"Counter":"qcache_max_bytes","Value":"%{NUMBER}"},
{"Counter":"qcache_thresh_msec","Value":"%{NUMBER}"},
{"Counter":"qcache_ttl_sec","Value":"%{NUMBER}"},
{"Counter":"qcache_cached_queries","Value":"%{NUMBER}"},
{"Counter":"qcache_used_bytes","Value":"%{NUMBER}"},
{"Counter":"qcache_hits","Value":"0"}
],
"total":75,
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20status" | awk '!/row.*in set/'; echo
––– output –––
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| Counter | Value |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| uptime | %{NUMBER} |
| connections | %{NUMBER} |
| maxed_out | %{NUMBER} |
| version | %{SEMVER} %{COMMITDATE} dev (columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE}) (buddy v%{SEMVER}) |
| mysql_version | %{SEMVER} %{COMMITDATE} dev (columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE}) |
| command_search | %{NUMBER} |
| command_excerpt | 0 |
| command_update | 0 |
| command_keywords | 0 |
| command_persist | 0 |
| command_status | %{NUMBER} |
| command_flushattrs | 0 |
| command_sphinxql | 0 |
| command_ping | 0 |
| command_delete | 0 |
| command_set | 0 |
| command_insert | %{NUMBER} |
| command_replace | 0 |
| command_commit | 0 |
| command_suggest | 0 |
| command_json | 0 |
| command_callpq | 0 |
| command_cluster | 0 |
| command_getfield | 0 |
| insert_replace_stats_ms_avg | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_min | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_max | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_pct95 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_pct99 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_avg | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_min | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_max | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_pct95 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_pct99 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| update_stats_ms_avg | N/A N/A N/A |
| update_stats_ms_min | N/A N/A N/A |
| update_stats_ms_max | N/A N/A N/A |
| update_stats_ms_pct95 | N/A N/A N/A |
| update_stats_ms_pct99 | N/A N/A N/A |
| agent_connect | 0 |
| agent_tfo | 0 |
| agent_retry | 0 |
| queries | %{NUMBER} |
| dist_queries | 0 |
| workers_total | %{NUMBER} |
| workers_active | %{NUMBER} |
| workers_clients | %{NUMBER} |
| workers_clients_vip | 0 |
| workers_clients_buddy | %{NUMBER} |
| work_queue_length | 6 |
| load | 0.00 0.00 0.00 |
| load_primary | 0.00 0.00 0.00 |
| load_secondary | 0.00 0.00 0.00 |
| query_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| query_cpu | OFF |
| dist_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| dist_local | #!/[0-9]{1}.[0-9]{3}/!# |
| dist_wait | #!/[0-9]{1}.[0-9]{3}/!# |
| query_reads | OFF |
| query_readkb | OFF |
| query_readtime | OFF |
| avg_query_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_query_cpu | OFF |
| avg_dist_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_dist_local | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_dist_wait | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_query_reads | OFF |
| avg_query_readkb | OFF |
| avg_query_readtime | OFF |
| qcache_max_bytes | 16777216 |
| qcache_thresh_msec | 3000 |
| qcache_ttl_sec | 60 |
| qcache_cached_queries | 0 |
| qcache_used_bytes | 0 |
| qcache_hits | 0 |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE big_table (id INT, value TEXT);"
––– output –––
––– input –––
for i in $(seq 1 1000000); do echo "INSERT INTO big_table VALUES ($i, 'value_$i');"; done | mysql -h0 -P9306
––– output –––
––– input –––
curl -s "http://localhost:9308/cli?select%20*%20from%20big_table%20limit%2010" | awk '!/row.*in set/'; echo
––– output –––
+--------+--------------+
| id | value |
+--------+--------------+
| 939142 | value_939142 |
| 418023 | value_418023 |
| 418022 | value_418022 |
| 939140 | value_939140 |
| 418021 | value_418021 |
| 939141 | value_939141 |
| 418020 | value_418020 |
| 939138 | value_939138 |
| 939139 | value_939139 |
| 418019 | value_418019 |
+--------+--------------+
––– input –––
curl -s "http://localhost:9308/cli?select%20count(*)%20as%20total%20from%20big_table" | awk '!/row.*in set/'; echo
––– output –––
+---------+
| total |
+---------+
| 1000000 |
+---------+
––– input –––
curl -s "http://localhost:9308/cli?drop%20table%20big_table" | awk '!/Query OK/ && !/rows affected/'; echo
––– output –––
––– input –––
curl -X POST "http://localhost:9308/sql" -d "EXPLAIN FORMAT=json SELECT * FROM t WHERE MATCH('example')"; echo
––– output –––
{"error":"P01: syntax error, unexpected '=' near '=json SELECT * FROM t WHERE MATCH('example')'"}
test/clt-tests/core/test-knn-id.rec––– 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() |
+------+------------+
- | 1 | 0 |
+ | 2 | 1.14755321 |
- | 2 | 1.14755321 |
+ +------+------------+
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "select * from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+------------+---------------------------------------+------------+
+ +------+-----------+---------------------------------------+------------+
- | id | title | image_vector | @knn_dist |
+ | id | title | image_vector | @knn_dist |
- +------+------------+---------------------------------------+------------+
+ +------+-----------+---------------------------------------+------------+
- | 1 | yellow bag | 0.653448,0.192478,0.017971,0.339821 | 0 |
+ | 2 | white bag | -0.148894,0.748278,0.091892,-0.095406 | 1.14755321 |
- | 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() |
+------+------------+
- | 1 | 0 |
+ | 5 | 0.16000001 |
- | 5 | 0.16000001 |
+ | 2 | 0.27772635 |
- | 2 | 0.27772635 |
+ | 9 | 0.78000003 |
- | 9 | 0.78000003 |
+ | 3 | 0.81000006 |
- | 3 | 0.81000006 |
+ | 7 | 1.020000 |
- | 7 | 1.020000 |
+ | 6 | 1.100000 |
- | 6 | 1.100000 |
+ | 10 | 1.260000 |
- | 10 | 1.260000 |
+ | 8 | 1.300000 |
- | 8 | 1.300000 |
+ | 4 | 1.75999987 |
- | 4 | 1.75999987 |
+ +------+------------+
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT id, knn_dist() FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
+------+------------+
| id | knn_dist() |
+------+------------+
- | 1 | 0 |
+ | 5 | 0.16000001 |
- | 5 | 0.16000001 |
+ | 2 | 0.27772635 |
- | 2 | 0.27772635 |
+ | 9 | 0.78000003 |
- | 9 | 0.78000003 |
+ | 3 | 0.81000006 |
- | 3 | 0.81000006 |
+ | 7 | 1.020000 |
- | 7 | 1.020000 |
+ | 6 | 1.100000 |
- | 6 | 1.100000 |
+ | 10 | 1.260000 |
- | 10 | 1.260000 |
+ | 8 | 1.300000 |
- | 8 | 1.300000 |
+ | 4 | 1.75999987 |
- | 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 |
+------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
- | 1 | Model_1 | Color_1 | 1 | 1620590570251 | 512 | 2022 | 654.190002 | 855.340027 | [81,56,60] | [96,389,27] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.100000,0.200000,0.300000,0.400000 | 0 |
+ | 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 |
- | 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 |
- | 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 |
- | 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 |
- | 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 |
- | 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 |
- | 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 |
- | 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 |
- | 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 |
- | 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 |
+----------+
|
clt👎 CLT tests in test/clt-tests/core/show-version-http.rec––– 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 t (id INT, value TEXT); INSERT INTO t VALUES (1, 'example'), (2, 'test');"
––– output –––
––– input –––
curl -s "http://localhost:9308/cli?show%20version" | awk '!/row.*in set/'; echo
––– output –––
- +-----------+----------------------------------+
+ [{"total":5,"error":"","warning":"","columns":[{"Component":{"type":"string"}},{"Version":{"type":"string"}}],"data":[{"Component":"Daemon","Version":"6.3.9 4c92014aa@24112500 dev"},{"Component":"Columnar","Version":"columnar 2.3.1 edadc69@24112219"},{"Component":"Secondary","Version":"secondary 2.3.1 edadc69@24112219"},{"Component":"KNN","Version":"knn 2.3.1 edadc69@24112219"},{"Component":"Buddy","Version":"buddy v3.0.1"}]}]
- | Component | Version |
- +-----------+----------------------------------+
- | Daemon | %{SEMVER} %{COMMITDATE} dev |
- | Columnar | columnar %{SEMVER} %{COMMITDATE} |
- | Secondary | secondary %{SEMVER} %{COMMITDATE} |
- | KNN | knn %{SEMVER} %{COMMITDATE} |
- | Buddy | buddy v%{SEMVER} |
- +-----------+----------------------------------+
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | awk '!/row.*in set/'; echo
––– output –––
+-------+------+
| Table | Type |
+-------+------+
| t | rt |
+-------+------+
––– input –––
curl -s "http://localhost:9308/cli?select%20*%20from%20t%20where%20match('example')" | awk '!/row.*in set/'; echo
––– output –––
+----+---------+
| id | value |
+----+---------+
| 1 | example |
+----+---------+
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show version"; echo
––– output –––
[{"total":5,"error":"","warning":"","columns":[{"Component":{"type":"string"}},{"Version":{"type":"string"}}],"data":[{"Component":"Daemon","Version":"%{SEMVER} %{COMMITDATE} dev"},{"Component":"Columnar","Version":"columnar %{SEMVER} %{COMMITDATE}"},{"Component":"Secondary","Version":"secondary %{SEMVER} %{COMMITDATE}"},{"Component":"KNN","Version":"knn %{SEMVER} %{COMMITDATE}"},{"Component":"Buddy","Version":"buddy v%{SEMVER}"}]}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
{"Table":"t","Type":"rt"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "select * from t where match('example')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
{"id":1,"value":"example"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql" -d "select * from t"; echo
––– output –––
{"took":%{NUMBER},"timed_out":false,"hits":{"total":2,"total_relation":"eq","hits":[{"_id":1,"_score":1,"_source":{"value":"example"}},{"_id":2,"_score":1,"_source":{"value":"test"}}]}}
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "select * from t"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
{"id":1,"value":"example"},
{"id":2,"value":"test"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
{"Table":"t","Type":"rt"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli_json" -d "select * from t where match('nonexistent')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -X POST "http://localhost:9308/sql?mode=raw" -d "select * from t where match('nonexistent')"; echo
––– output –––
[{
"columns":[{"id":{"type":"long long"}},{"value":{"type":"string"}}],
"data":[
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | sed '/row.*in set/d' | sed 's/ (.*sec)//'; echo
––– output –––
+-------+------+
| Table | Type |
+-------+------+
| t | rt |
+-------+------+
––– input –––
curl -s "http://localhost:9308/cli?describe%20t" | awk '!/row.*in set/'; echo
––– output –––
+-------+--------+----------------+
| Field | Type | Properties |
+-------+--------+----------------+
| id | bigint | |
| value | text | indexed stored |
+-------+--------+----------------+
––– input –––
curl -s "http://localhost:9308/cli_json" -d "DESCRIBE t"; echo
––– output –––
[{
"columns":[{"Field":{"type":"string"}},{"Type":{"type":"string"}},{"Properties":{"type":"string"}}],
"data":[
{"Field":"id","Type":"bigint","Properties":""},
{"Field":"value","Type":"text","Properties":"indexed stored"}
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?drop%20table%20t" | awk '!/Query OK/ && !/rows affected/'; echo
––– output –––
––– input –––
curl -s "http://localhost:9308/cli_json" -d "show tables"; echo
––– output –––
[{
"columns":[{"Table":{"type":"string"}},{"Type":{"type":"string"}}],
"data":[
],
"total":%{NUMBER},
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20tables" | sed 's/ (.*sec)//'; echo
––– output –––
Empty set
––– input –––
curl -s "http://localhost:9308/cli_json" -d "SHOW STATUS"; echo
––– output –––
[{
"columns":[{"Counter":{"type":"string"}},{"Value":{"type":"string"}}],
"data":[
{"Counter":"uptime","Value":"%{NUMBER}"},
{"Counter":"connections","Value":"%{NUMBER}"},
{"Counter":"maxed_out","Value":"%{NUMBER}"},
{"Counter":"version","Value":"%{SEMVER} %{COMMITDATE} dev (columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE}) (buddy v%{SEMVER})"},
{"Counter":"mysql_version","Value":"%{SEMVER} %{COMMITDATE} dev (columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE})"},
{"Counter":"command_search","Value":"%{NUMBER}"},
{"Counter":"command_excerpt","Value":"%{NUMBER}"},
{"Counter":"command_update","Value":"%{NUMBER}"},
{"Counter":"command_keywords","Value":"%{NUMBER}"},
{"Counter":"command_persist","Value":"%{NUMBER}"},
{"Counter":"command_status","Value":"%{NUMBER}"},
{"Counter":"command_flushattrs","Value":"%{NUMBER}"},
{"Counter":"command_sphinxql","Value":"%{NUMBER}"},
{"Counter":"command_ping","Value":"%{NUMBER}"},
{"Counter":"command_delete","Value":"%{NUMBER}"},
{"Counter":"command_set","Value":"%{NUMBER}"},
{"Counter":"command_insert","Value":"%{NUMBER}"},
{"Counter":"command_replace","Value":"%{NUMBER}"},
{"Counter":"command_commit","Value":"%{NUMBER}"},
{"Counter":"command_suggest","Value":"%{NUMBER}"},
{"Counter":"command_json","Value":"%{NUMBER}"},
{"Counter":"command_callpq","Value":"%{NUMBER}"},
{"Counter":"command_cluster","Value":"%{NUMBER}"},
{"Counter":"command_getfield","Value":"%{NUMBER}"},
{"Counter":"insert_replace_stats_ms_avg","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_min","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_max","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_pct95","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"insert_replace_stats_ms_pct99","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_avg","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_min","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_max","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_pct95","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"search_stats_ms_pct99","Value":"#!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"update_stats_ms_avg","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_min","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_max","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_pct95","Value":"N/A N/A N/A"},
{"Counter":"update_stats_ms_pct99","Value":"N/A N/A N/A"},
{"Counter":"agent_connect","Value":"%{NUMBER}"},
{"Counter":"agent_tfo","Value":"%{NUMBER}"},
{"Counter":"agent_retry","Value":"%{NUMBER}"},
{"Counter":"queries","Value":"%{NUMBER}"},
{"Counter":"dist_queries","Value":"%{NUMBER}"},
{"Counter":"workers_total","Value":"%{NUMBER}"},
{"Counter":"workers_active","Value":"%{NUMBER}"},
{"Counter":"workers_clients","Value":"%{NUMBER}"},
{"Counter":"workers_clients_vip","Value":"%{NUMBER}"},
{"Counter":"workers_clients_buddy","Value":"%{NUMBER}"},
{"Counter":"work_queue_length","Value":"6"},
{"Counter":"load","Value":"0.00 0.00 0.00"},
{"Counter":"load_primary","Value":"0.00 0.00 0.00"},
{"Counter":"load_secondary","Value":"0.00 0.00 0.00"},
{"Counter":"query_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"query_cpu","Value":"OFF"},
{"Counter":"dist_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"dist_local","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"dist_wait","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"query_reads","Value":"OFF"},
{"Counter":"query_readkb","Value":"OFF"},
{"Counter":"query_readtime","Value":"OFF"},
{"Counter":"avg_query_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"avg_query_cpu","Value":"OFF"},
{"Counter":"avg_dist_wall","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"avg_dist_local","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"avg_dist_wait","Value":"#!/[0-9]{1}.[0-9]{3}/!#"},
{"Counter":"avg_query_reads","Value":"OFF"},
{"Counter":"avg_query_readkb","Value":"OFF"},
{"Counter":"avg_query_readtime","Value":"OFF"},
{"Counter":"qcache_max_bytes","Value":"%{NUMBER}"},
{"Counter":"qcache_thresh_msec","Value":"%{NUMBER}"},
{"Counter":"qcache_ttl_sec","Value":"%{NUMBER}"},
{"Counter":"qcache_cached_queries","Value":"%{NUMBER}"},
{"Counter":"qcache_used_bytes","Value":"%{NUMBER}"},
{"Counter":"qcache_hits","Value":"0"}
],
"total":75,
"error":"",
"warning":""
}]
––– input –––
curl -s "http://localhost:9308/cli?show%20status" | awk '!/row.*in set/'; echo
––– output –––
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| Counter | Value |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| uptime | %{NUMBER} |
| connections | %{NUMBER} |
| maxed_out | %{NUMBER} |
| version | %{SEMVER} %{COMMITDATE} dev (columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE}) (buddy v%{SEMVER}) |
| mysql_version | %{SEMVER} %{COMMITDATE} dev (columnar %{SEMVER} %{COMMITDATE}) (secondary %{SEMVER} %{COMMITDATE}) (knn %{SEMVER} %{COMMITDATE}) |
| command_search | %{NUMBER} |
| command_excerpt | 0 |
| command_update | 0 |
| command_keywords | 0 |
| command_persist | 0 |
| command_status | %{NUMBER} |
| command_flushattrs | 0 |
| command_sphinxql | 0 |
| command_ping | 0 |
| command_delete | 0 |
| command_set | 0 |
| command_insert | %{NUMBER} |
| command_replace | 0 |
| command_commit | 0 |
| command_suggest | 0 |
| command_json | 0 |
| command_callpq | 0 |
| command_cluster | 0 |
| command_getfield | 0 |
| insert_replace_stats_ms_avg | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_min | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_max | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_pct95 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| insert_replace_stats_ms_pct99 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_avg | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_min | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_max | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_pct95 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| search_stats_ms_pct99 | #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# #!/[0-9]{1}.[0-9]{3}/!# |
| update_stats_ms_avg | N/A N/A N/A |
| update_stats_ms_min | N/A N/A N/A |
| update_stats_ms_max | N/A N/A N/A |
| update_stats_ms_pct95 | N/A N/A N/A |
| update_stats_ms_pct99 | N/A N/A N/A |
| agent_connect | 0 |
| agent_tfo | 0 |
| agent_retry | 0 |
| queries | %{NUMBER} |
| dist_queries | 0 |
| workers_total | %{NUMBER} |
| workers_active | %{NUMBER} |
| workers_clients | %{NUMBER} |
| workers_clients_vip | 0 |
| workers_clients_buddy | %{NUMBER} |
| work_queue_length | 6 |
| load | 0.00 0.00 0.00 |
| load_primary | 0.00 0.00 0.00 |
| load_secondary | 0.00 0.00 0.00 |
| query_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| query_cpu | OFF |
| dist_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| dist_local | #!/[0-9]{1}.[0-9]{3}/!# |
| dist_wait | #!/[0-9]{1}.[0-9]{3}/!# |
| query_reads | OFF |
| query_readkb | OFF |
| query_readtime | OFF |
| avg_query_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_query_cpu | OFF |
| avg_dist_wall | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_dist_local | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_dist_wait | #!/[0-9]{1}.[0-9]{3}/!# |
| avg_query_reads | OFF |
| avg_query_readkb | OFF |
| avg_query_readtime | OFF |
| qcache_max_bytes | 16777216 |
| qcache_thresh_msec | 3000 |
| qcache_ttl_sec | 60 |
| qcache_cached_queries | 0 |
| qcache_used_bytes | 0 |
| qcache_hits | 0 |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE big_table (id INT, value TEXT);"
––– output –––
––– input –––
for i in $(seq 1 1000000); do echo "INSERT INTO big_table VALUES ($i, 'value_$i');"; done | mysql -h0 -P9306
––– output –––
––– input –––
curl -s "http://localhost:9308/cli?select%20*%20from%20big_table%20limit%2010" | awk '!/row.*in set/'; echo
––– output –––
+--------+--------------+
| id | value |
+--------+--------------+
| 939142 | value_939142 |
| 418023 | value_418023 |
| 418022 | value_418022 |
| 939140 | value_939140 |
| 418021 | value_418021 |
| 939141 | value_939141 |
| 418020 | value_418020 |
| 939138 | value_939138 |
| 939139 | value_939139 |
| 418019 | value_418019 |
+--------+--------------+
––– input –––
curl -s "http://localhost:9308/cli?select%20count(*)%20as%20total%20from%20big_table" | awk '!/row.*in set/'; echo
––– output –––
+---------+
| total |
+---------+
| 1000000 |
+---------+
––– input –––
curl -s "http://localhost:9308/cli?drop%20table%20big_table" | awk '!/Query OK/ && !/rows affected/'; echo
––– output –––
––– input –––
curl -X POST "http://localhost:9308/sql" -d "EXPLAIN FORMAT=json SELECT * FROM t WHERE MATCH('example')"; echo
––– output –––
{"error":"P01: syntax error, unexpected '=' near '=json SELECT * FROM t WHERE MATCH('example')'"}
|
@donhardman, the output mentioned here – link – seems incorrect since we expect a tabular format in this case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add more Buddy-handled queries to our test suite. Currently, we test many Manticore Search queries, but we should limit these to 1-2 examples since they use the same endpoint. For example, we can keep:
- Simple
SELECT * FROM
SHOW SETTINGS
(for both table and JSON formats via CLI and CLI_JSON)
Additional test cases we should consider adding for Buddy-specific functionality:
- Fuzzy search
- Autocomplete calls
- SHOW queries
- Show version
- Maybe something else?
These tests would ensure that table formatting works correctly for all plugin operations handled by Buddy.
Make sure for each single query perform /cli
and /cli_json
Closing due to migrating to new CI; moved to #2830 |
Update buddy version to: 3.0.1 24103007 de3dbcf which includes:
de3dbcf
Merge 3027c11e73cddf323aadbb0fa2d49d97172e9765 into 20200a1ba5e4116c4b2798c2474b0cd4c5738a833027c11
Fix issue with elastic tests and improve output20200a1
Update README.md: fixed a mistype about "current version"6cd8509
Update composer deps986e64d
Update code to reflect latest refactoring with fixing table output in automated way for all plugins27cae08
Refactor to support automatic CLI table output for all Buddy plugins not just Showb8acd10
Add new update-deps action and trigger the workflow from the pull request also