Skip to content

Conversation

@sanikolaev
Copy link
Collaborator

@sanikolaev sanikolaev commented Nov 25, 2025

manticore-load --port=9306 --drop --batch-size=1 --threads=5 --total=100000 --init="CREATE TABLE t(f text) min_infix_len='2'" --load="INSERT INTO t(f) values('<string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42>')";

Master branch:

[Tue Nov 25 10:13:47.325 2025] [1918600] rt: table t: diskchunk 0(1), segments 32  saved in 113.287358 (113.288013) sec, RAM saved/new 44738922/89474521 ratio 0.333342 (soft limit 44740350, conf limit 134217728)
[Tue Nov 25 10:13:54.455 2025] [1918606] rt: table t: diskchunk 1(2), segments 32  saved in 112.899586 (112.933800) sec, RAM saved/new 44743457/86447102 ratio 0.341057 (soft limit 45775894, conf limit 134217728)
[Tue Nov 25 10:15:40.540 2025] [1918609] rt: table t: diskchunk 2(3), segments 32  saved in 113.141336 (113.141897) sec, RAM saved/new 44741287/89474498 ratio 0.333353 (soft limit 44741934, conf limit 134217728)
[Tue Nov 25 10:15:51.816 2025] [1918610] rt: table t: diskchunk 3(4), segments 32  saved in 116.618959 (116.619502) sec, RAM saved/new 45771884/88440004 ratio 0.341042 (soft limit 45773875, conf limit 134217728)
[Tue Nov 25 10:17:33.867 2025] [1918612] rt: table t: diskchunk 4(5), segments 32  saved in 113.132860 (113.133430) sec, RAM saved/new 44733586/89478590 ratio 0.333333 (soft limit 44739197, conf limit 134217728)
[Tue Nov 25 10:17:48.771 2025] [1918606] rt: table t: diskchunk 5(6), segments 32  saved in 116.462339 (116.462895) sec, RAM saved/new 45771396/88445594 ratio 0.341025 (soft limit 45771647, conf limit 134217728)
[Tue Nov 25 10:19:28.656 2025] [1918608] rt: table t: diskchunk 6(7), segments 32  saved in 114.524230 (114.524747) sec, RAM saved/new 44731400/89489845 ratio 0.333333 (soft limit 44739197, conf limit 134217728)
[Tue Nov 25 10:19:46.771 2025] [1918609] rt: table t: diskchunk 7(8), segments 32  saved in 117.516967 (117.517525) sec, RAM saved/new 45768703/88441304 ratio 0.341023 (soft limit 45771336, conf limit 134217728)
[Tue Nov 25 10:21:23.372 2025] [1918610] rt: table t: diskchunk 8(9), segments 32  saved in 114.437871 (114.438446) sec, RAM saved/new 44738690/89475923 ratio 0.333337 (soft limit 44739728, conf limit 134217728)
[Tue Nov 25 10:21:43.966 2025] [1918603] rt: table t: diskchunk 9(10), segments 32  saved in 116.706442 (116.706937) sec, RAM saved/new 45768703/58115316 ratio 0.440575 (soft limit 59132977, conf limit 134217728)
[Tue Nov 25 10:23:11.956 2025] [1918605] rt: table t: diskchunk 10(11), segments 32  saved in 108.308400 (108.309066) sec, RAM saved/new 44738153/13377163 ratio 0.769817 (soft limit 103323076, conf limit 134217728)

This branch:

[Tue Nov 25 10:07:18.656 2025] [1897162] rt: table t: diskchunk 0(1), segments 32  saved in 30.944205 (30.944761) sec, RAM saved/new 44737133/89471067 ratio 0.333341 (soft limit 44740309, conf limit 134217728)
[Tue Nov 25 10:07:26.422 2025] [1897170] rt: table t: diskchunk 1(2), segments 32  saved in 31.278867 (31.282967) sec, RAM saved/new 44734008/89069584 ratio 0.334326 (soft limit 44872464, conf limit 134217728)
[Tue Nov 25 10:07:51.330 2025] [1897172] rt: table t: diskchunk 2(3), segments 32  saved in 32.518803 (32.519357) sec, RAM saved/new 44737059/89480110 ratio 0.333333 (soft limit 44739197, conf limit 134217728)
[Tue Nov 25 10:07:58.731 2025] [1897165] rt: table t: diskchunk 3(4), segments 32  saved in 32.112853 (32.114522) sec, RAM saved/new 44868478/87330823 ratio 0.339400 (soft limit 45553532, conf limit 134217728)
[Tue Nov 25 10:08:23.398 2025] [1897170] rt: table t: diskchunk 4(5), segments 32  saved in 31.892372 (31.893017) sec, RAM saved/new 44733385/89479394 ratio 0.333333 (soft limit 44739197, conf limit 134217728)
[Tue Nov 25 10:08:31.997 2025] [1897171] rt: table t: diskchunk 5(6), segments 32  saved in 32.594372 (32.594889) sec, RAM saved/new 45560058/88654453 ratio 0.339457 (soft limit 45561150, conf limit 134217728)
[Tue Nov 25 10:08:55.375 2025] [1897162] rt: table t: diskchunk 6(7), segments 32  saved in 31.657734 (31.658331) sec, RAM saved/new 44737396/89476638 ratio 0.333333 (soft limit 44739197, conf limit 134217728)
[Tue Nov 25 10:09:04.768 2025] [1897168] rt: table t: diskchunk 7(8), segments 32  saved in 32.312303 (32.312831) sec, RAM saved/new 45561893/88651305 ratio 0.339474 (soft limit 45563430, conf limit 134217728)
[Tue Nov 25 10:09:28.566 2025] [1897163] rt: table t: diskchunk 8(9), segments 32  saved in 32.851123 (32.851750) sec, RAM saved/new 44743075/89469447 ratio 0.333375 (soft limit 44744810, conf limit 134217728)
[Tue Nov 25 10:09:37.910 2025] [1897160] rt: table t: diskchunk 9(10), segments 32  saved in 32.640951 (32.641557) sec, RAM saved/new 45566919/58606699 ratio 0.437413 (soft limit 58708610, conf limit 134217728)
[Tue Nov 25 10:09:58.466 2025] [1897167] rt: table t: diskchunk 10(11), segments 32  saved in 29.593349 (29.593861) sec, RAM saved/new 44746669/13860030 ratio 0.763508 (soft limit 102476275, conf limit 134217728)

…sed arena size

- Enhanced the infix hash builder by implementing an optimized radix sort for better performance.
- Increased the arena size from 1M to 16M buckets to accommodate larger datasets.
- Added a new operator for Infix_t to support comparisons.
- Improved cache locality by pre-extracting key words during sorting.
@sanikolaev sanikolaev added the pack To trigger CI to build packages for PR label Nov 25, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 25, 2025

Linux release test results

1 139 tests   1 085 ✅  15m 53s ⏱️
    1 suites     54 💤
    1 files        0 ❌

Results for commit 656f5db.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

clt

❌ CLT tests in test/clt-tests/buddy-plugins/
✅ OK: 7
❌ Failed: 2
⏳ Duration: 84s
👉 Check Action Results for commit b312d02

Failed tests:

🔧 Edit failed tests in UI:

test/clt-tests/buddy-plugins/test-fuzzy-search.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd $SEARCHD_FLAGS > /dev/null; 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 –––
OK
––– input –––
apt-get update -y > /dev/null; echo $?
––– output –––
OK
––– input –––
apt-get install jq -y > /dev/null; echo $?
––– output –––
OK
––– input –––
php -d memory_limit=2G ./test/clt-tests/scripts/load_names_attr.php --batch-size=100000 --concurrency=1 --docs=1000000 --start-id=1 --min-infix-len=2 > /dev/null; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name ORDER BY id ASC LIMIT 1000000 OPTION max_matches=1000000;" > /tmp/name_data.txt
––– output –––
OK
––– input –––
md5sum /tmp/name_data.txt
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE name;" | grep "min_infix_len='2'" | sed "s/.\(min_infix_len='2'\)./\1/"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT COUNT(*) FROM name;"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "OPTIMIZE TABLE name OPTION sync=1;"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('RICH') ORDER BY id ASC, username ASC OPTION fuzzy=1;"
––– output –––
- +------+---------------------+------+
+ +-------+-----------------+------+
- | id   | username            | s    |
+ | id    | username        | s    |
- +------+---------------------+------+
+ +-------+-----------------+------+
- |   43 | KOURTNEY RICHARDSON | a    |
+ |   363 | MAYRA RICO      | a    |
- |  125 | ELAINA RICHARDSON   | a    |
+ |   840 | RICO MCFADDEN   | a    |
- |  226 | RICHARD ZAMARRIPA   | a    |
+ |   934 | VALERY RICH     | a    |
- |  363 | MAYRA RICO          | a    |
+ |  4409 | JACQUELIN RICO  | a    |
- |  840 | RICO MCFADDEN       | a    |
+ |  6020 | RICH MAYES      | a    |
- |  855 | RICHARD ALDRIDGE    | a    |
+ |  6626 | RICO MCEWEN     | a    |
- |  934 | VALERY RICH         | a    |
+ |  9562 | KATHLEEN RICO   | a    |
- |  948 | REGINE ALDRICH      | a    |
+ | 11476 | RICO GLADDEN    | a    |
- | 1017 | HEE TRICE           | a    |
+ | 13917 | RICO HOLLY      | a    |
- | 1624 | OLEVIA RICHARDS     | a    |
+ | 17550 | VIRGINIA RICO   | a    |
- | 1816 | MAURICE BARCLAY     | a    |
+ | 17890 | ANGELO RICE     | a    |
- | 2228 | THERESIA RICHARDS   | a    |
+ | 18819 | FREDRIC RICO    | a    |
- | 2670 | JULIANA GRICE       | a    |
+ | 20555 | JULIA RICH      | a    |
- | 2918 | GRICELDA WHELAN     | a    |
+ | 20566 | SHARAN RICE     | a    |
- | 3012 | RICHARD MCCURDY     | a    |
+ | 21569 | NICHOLAS RICH   | a    |
- | 3147 | MERRILEE ALDRICH    | a    |
+ | 22557 | KYONG RICH      | a    |
- | 3262 | FONDA RICHEY        | a    |
+ | 24141 | HORTENSIA RICH  | a    |
- | 3431 | MELANY RICHARD      | a    |
+ | 25952 | GRAZYNA RICO    | a    |
- | 3438 | JOVAN ALDRICH       | a    |
+ | 27287 | RICO STAUFFER   | a    |
- | 3517 | BRICE LONGORIA      | a    |
+ | 27341 | RICO PELLEGRINO | a    |
- +------+---------------------+------+
+ +-------+-----------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('EBGRNA') ORDER BY id ASC, username ASC OPTION fuzzy=1;"
––– output –––
- +------+----------------------+------+
- | id   | username             | s    |
- +------+----------------------+------+
- |   20 | BERNARDO DUGGAN      | a    |
- |   27 | BERNARDINE BREWER    | a    |
- |  209 | KATLYN SERNA         | a    |
- | 1292 | LAVERNA CLARK        | a    |
- | 1414 | BENNY FERNANDEZ      | a    |
- | 1638 | JULENE BERNAL        | a    |
- | 2021 | LAVERNA JEFFERSON    | a    |
- | 2169 | MERNA ORNELAS        | a    |
- | 2471 | BERNADINE SCANLON    | a    |
- | 2843 | BERNADINE NAPOLITANO | a    |
- | 3177 | FERNANDA FRYER       | a    |
- | 3199 | FERNANDO FRANCISCO   | a    |
- | 3455 | FERNANDE MERRITT     | a    |
- | 3539 | BERNADINE HILLER     | a    |
- | 3862 | FERNANDO MACDONALD   | a    |
- | 4022 | JOHNSON HERNANDES    | a    |
- | 4484 | SYBIL HERNANDES      | a    |
- | 5159 | MARTINA BERNARD      | a    |
- | 5793 | BERNA TALBOTT        | a    |
- | 6506 | FERNANDO FREELAND    | a    |
- +------+----------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('ANT') ORDER BY id ASC, username ASC OPTION fuzzy=1;"
––– output –––
- +------+--------------------+------+
- | id   | username           | s    |
- +------+--------------------+------+
- |    6 | KESHIA RANDAZZO    | a    |
- |   12 | TRESA ESCALANTE    | a    |
- |   20 | BERNARDO DUGGAN    | a    |
- |   31 | DEMETRIA IBANEZ    | a    |
- |   32 | PAMELIA SANDLIN    | a    |
- |   34 | ANJANETTE MINTON   | a    |
- |   40 | ANTONIO RIOS       | a    |
- |   62 | ANDRES NATION      | a    |
- |   64 | MERI MEDRANO       | a    |
- |   65 | JANINA FLANIGAN    | a    |
- |   72 | TALISHA SWAN       | a    |
- |   75 | JANAY BONNER       | a    |
- |   80 | DEMETRIA STANFIELD | a    |
- |   81 | RALEIGH SANDBERG   | a    |
- |   82 | KRISTIAN MEYER     | a    |
- |   83 | JANN HEATH         | a    |
- |   87 | RANDEE QUINTERO    | a    |
- |   99 | DEAN GUO           | a    |
- |  103 | DEAN DEAL          | a    |
- |  110 | CONSTANCE REES     | a    |
- +------+--------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('tony') ORDER BY id ASC, username ASC OPTION fuzzy=1;"
––– output –––
- +-------+------------------+------+
+ +-------+-------------------+------+
- | id    | username         | s    |
+ | id    | username          | s    |
- +-------+------------------+------+
+ +-------+-------------------+------+
- |   688 | SHERIE STORY     | a    |
+ |  2154 | TONY GREY         | a    |
- |  1422 | TOBY CARO        | a    |
+ |  5687 | TONY EASTERLING   | a    |
- |  1627 | RUPERT STORY     | a    |
+ |  9619 | TONY WHITTINGTON  | a    |
- |  2154 | TONY GREY        | a    |
+ | 13713 | TONY DEBOER       | a    |
- |  3759 | TOBY GILCHRIST   | a    |
+ | 15578 | TONY GAY          | a    |
- |  5687 | TONY EASTERLING  | a    |
+ | 16078 | TONY CASWELL      | a    |
- |  5835 | TOBY ROBERSON    | a    |
+ | 16138 | TONY RABER        | a    |
- |  6281 | TOBY ARAIZA      | a    |
+ | 24613 | TONY BRAUN        | a    |
- |  7311 | ANTONY STOVALL   | a    |
+ | 25496 | TONY BERGMAN      | a    |
- |  7475 | TOBY REINHART    | a    |
+ | 33343 | TONY SOUTHERN     | a    |
- |  8828 | TONYA CALLAHAN   | a    |
+ | 40402 | TONY ESPARZA      | a    |
- |  9251 | TOBY LANGFORD    | a    |
+ | 42486 | TONY APARICIO     | a    |
- |  9293 | ZENA STORY       | a    |
+ | 44087 | TONY DABNEY       | a    |
- |  9619 | TONY WHITTINGTON | a    |
+ | 45395 | TONY MANNING      | a    |
- | 10167 | LANA STORY       | a    |
+ | 45967 | TONY HAMMONDS     | a    |
- | 10341 | ANTONY KAYE      | a    |
+ | 46732 | TONY SENA         | a    |
- | 12573 | LATONYA CRABTREE | a    |
+ | 49321 | TONY COLEMAN      | a    |
- | 12876 | TOBY MONTENEGRO  | a    |
+ | 50358 | TONY HIGGINBOTHAM | a    |
- | 13391 | ANTONY CARRILLO  | a    |
+ | 52342 | TONY WILLARD      | a    |
- | 13672 | LEZLIE STORY     | a    |
+ | 53656 | TONY BICKEL       | a    |
- +-------+------------------+------+
+ +-------+-------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('SMITH') ORDER BY id DESC, username ASC OPTION fuzzy=1;"
––– output –––
- +--------+-----------------+------+
- | id     | username        | s    |
- +--------+-----------------+------+
- | 999737 | KEITH STUMP     | a    |
- | 999039 | KEITH JAMIESON  | a    |
- | 996439 | KEITHA CARBAJAL | a    |
- | 995770 | KEITH GONZALES  | a    |
- | 990882 | MINH SANTANA    | a    |
- | 990643 | KEITH MENDES    | a    |
- | 989972 | KEITHA WALTERS  | a    |
- | 989954 | GWENN SMYTH     | a    |
- | 989444 | KEITH KEATON    | a    |
- | 988755 | SHERRON SMYTH   | a    |
- | 988366 | LAVONIA SMYTH   | a    |
- | 988254 | MAYOLA KEITH    | a    |
- | 987106 | KEITH FAULK     | a    |
- | 986580 | DARNELL SMYTH   | a    |
- | 984012 | KEITH CORONEL   | a    |
- | 982759 | MORGAN KEITH    | a    |
- | 982421 | KEITH SHIFFLETT | a    |
- | 982223 | TELMA KEITH     | a    |
- | 982056 | RENITA KEITH    | a    |
- | 981115 | KATIE SMYTH     | a    |
- +--------+-----------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('SMYTH') ORDER BY id DESC, username ASC OPTION fuzzy=1;"
––– output –––
+--------+----------------+------+
| id     | username       | s    |
+--------+----------------+------+
- | 998829 | EDYTHE VACA    | a    |
+ | 989954 | GWENN SMYTH    | a    |
- | 998500 | SETH PHUNG     | a    |
+ | 988755 | SHERRON SMYTH  | a    |
- | 996507 | SETH LYMAN     | a    |
+ | 988366 | LAVONIA SMYTH  | a    |
- | 995119 | EDYTHE JOHN    | a    |
+ | 986580 | DARNELL SMYTH  | a    |
- | 993455 | EDYTH ROSADO   | a    |
+ | 981115 | KATIE SMYTH    | a    |
- | 992097 | EDYTH RAGAN    | a    |
+ | 975841 | ALEIDA SMYTH   | a    |
- | 989954 | GWENN SMYTH    | a    |
+ | 974429 | DEMETRIA SMYTH | a    |
- | 988823 | SETH WHITTAKER | a    |
+ | 973985 | LOGAN SMYTH    | a    |
- | 988755 | SHERRON SMYTH  | a    |
+ | 969183 | SCOTTY SMYTH   | a    |
- | 988366 | LAVONIA SMYTH  | a    |
+ | 960037 | EDGAR SMYTH    | a    |
- | 986580 | DARNELL SMYTH  | a    |
+ | 958857 | MIRTHA SMYTH   | a    |
- | 986231 | EDYTH BLODGETT | a    |
+ | 957495 | SIXTA SMYTH    | a    |
- | 985595 | SETH BACON     | a    |
+ | 953233 | LAWRENCE SMYTH | a    |
- | 982423 | SETH CHATMAN   | a    |
+ | 951184 | WILDA SMYTH    | a    |
- | 981115 | KATIE SMYTH    | a    |
+ | 944283 | HONG SMYTH     | a    |
- | 979541 | EDYTHE CLAYTON | a    |
+ | 936733 | BEV SMYTH      | a    |
- | 979093 | SETH BURROUGHS | a    |
+ | 935940 | CRISTY SMYTH   | a    |
- | 978812 | EDYTH GULLEY   | a    |
+ | 929866 | TEQUILA SMYTH  | a    |
- | 975994 | SETH PARHAM    | a    |
+ | 915866 | AMANDA SMYTH   | a    |
- | 975841 | ALEIDA SMYTH   | a    |
+ | 908615 | AMBERLY SMYTH  | a    |
+--------+----------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('SMITH') ORDER BY id DESC, username ASC OPTION fuzzy=\"1\";"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('john') ORDER BY id DESC, username ASC OPTION fuzzy=1;"
––– output –––
- +--------+--------------------+------+
+ +--------+-----------------+------+
- | id     | username           | s    |
+ | id     | username        | s    |
- +--------+--------------------+------+
+ +--------+-----------------+------+
- | 999971 | RONNA JOHNSON      | a    |
+ | 999655 | JOHN WAINWRIGHT | a    |
- | 999879 | CHARLEY STJOHN     | a    |
+ | 999440 | JOHN LEONG      | a    |
- | 999685 | JOAN KOESTER       | a    |
+ | 995376 | DOMONIQUE JOHN  | a    |
- | 999655 | JOHN WAINWRIGHT    | a    |
+ | 995119 | EDYTHE JOHN     | a    |
- | 999555 | JON MOSIER         | a    |
+ | 993439 | ARCHIE JOHN     | a    |
- | 999440 | JOHN LEONG         | a    |
+ | 993045 | JOHN HILDRETH   | a    |
- | 999170 | JONELLE HARDING    | a    |
+ | 990106 | JOHN CASWELL    | a    |
- | 999075 | JOHNIE DURAN       | a    |
+ | 988428 | HELAINE JOHN    | a    |
- | 999020 | JONAS HASAN        | a    |
+ | 987946 | JOHN USHER      | a    |
- | 998802 | RENETTA LITTLEJOHN | a    |
+ | 986706 | JOHN BOHN       | a    |
- | 998721 | REY JOHNSTON       | a    |
+ | 985882 | JOHN BREWSTER   | a    |
- | 998368 | JONIE MILTON       | a    |
+ | 985305 | TAUNYA JOHN     | a    |
- | 998367 | LEENA JOHNSTON     | a    |
+ | 982110 | CELINA JOHN     | a    |
- | 998128 | SHARILYN JOHNSTON  | a    |
+ | 980235 | JOHN HARDMAN    | a    |
- | 997788 | JOANNIE HENSON     | a    |
+ | 977317 | JOHN JORGENSEN  | a    |
- | 997670 | DENNY JONES        | a    |
+ | 977053 | JOHN ESCOBEDO   | a    |
- | 997623 | JOHNETTA DELATORRE | a    |
+ | 975483 | WELDON JOHN     | a    |
- | 997577 | JONA CORRAL        | a    |
+ | 974397 | JOHN PATE       | a    |
- | 997563 | JONE FOLSOM        | a    |
+ | 973982 | KIRA JOHN       | a    |
- | 997512 | JOAN CALKINS       | a    |
+ | 973504 | JOHN TERAN      | a    |
- +--------+--------------------+------+
+ +--------+-----------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('jane') AND id BETWEEN 10000 AND 20000 ORDER BY username ASC OPTION fuzzy=1;"
––– output –––
- +-------+----------------------+------+
+ +-------+---------------+------+
- | id    | username             | s    |
+ | id    | username      | s    |
- +-------+----------------------+------+
+ +-------+---------------+------+
- | 10119 | JANIECE GIBSON       | a    |
+ | 12608 | JAN DUPONT    | a    |
- | 10159 | JANNA MIXON          | a    |
+ | 13421 | JAN MARR      | a    |
- | 10200 | ELANE LOPES          | a    |
+ | 14313 | JAN CHAN      | a    |
- | 10205 | JANETTA ZHOU         | a    |
+ | 15190 | JAN BARRON    | a    |
- | 10381 | EULALIA LANE         | a    |
+ | 17623 | JAN MCWHORTER | a    |
- | 10465 | JANIE PAXTON         | a    |
+ +-------+---------------+------+
- | 10492 | JANINA JOE           | a    |
- | 10507 | JANNA EDDY           | a    |
- | 10635 | JANESSA GOODIN       | a    |
- | 10637 | JACQUELYNN JANKOWSKI | a    |
- | 10824 | ALEJANDRINA LAUGHLIN | a    |
- | 10831 | CLYDE JANES          | a    |
- | 10926 | JANNET GOODEN        | a    |
- | 10978 | JANAE KELSO          | a    |
- | 11064 | JANETH BOWIE         | a    |
- | 11266 | MARIELLE ALEJANDRO   | a    |
- | 11342 | JANAE DELAGARZA      | a    |
- | 11875 | TYLER LUJAN          | a    |
- | 11925 | DINAH JANES          | a    |
- | 11997 | JANETH BROWNING      | a    |
- +-------+----------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('EBGRNA') AND id BETWEEN 1000 AND 2000 ORDER BY username ASC OPTION fuzzy=1;"
––– output –––
- +------+-----------------+------+
- | id   | username        | s    |
- +------+-----------------+------+
- | 1292 | LAVERNA CLARK   | a    |
- | 1414 | BENNY FERNANDEZ | a    |
- | 1638 | JULENE BERNAL   | a    |
- +------+-----------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('SARA') ORDER BY id ASC, username ASC OPTION fuzzy=1;"
––– output –––
- +------+----------------------+------+
+ +-------+----------------+------+
- | id   | username             | s    |
+ | id    | username       | s    |
- +------+----------------------+------+
+ +-------+----------------+------+
- |   73 | CLARA NGUYEN         | a    |
+ |  2305 | SARA AVILA     | a    |
- | 1285 | CLARA CARTAGENA      | a    |
+ |  6165 | SARA HALLMAN   | a    |
- | 1515 | KLARA ALARCON        | a    |
+ |  8822 | SARA WEINBERG  | a    |
- | 1709 | FREDDA LARA          | a    |
+ | 10826 | SARA TELLEZ    | a    |
- | 2217 | LORIANN DELROSARIO   | a    |
+ | 11443 | SARA EDEN      | a    |
- | 2305 | SARA AVILA           | a    |
+ | 18085 | SARA SIMS      | a    |
- | 2631 | ROSARIA DELONG       | a    |
+ | 22346 | SARA STEINBERG | a    |
- | 3245 | LARA MASTERSON       | a    |
+ | 29990 | SARA SUMPTER   | a    |
- | 3267 | LARA MOREAU          | a    |
+ | 30605 | SARA DALEY     | a    |
- | 3553 | SARAN CHANG          | a    |
+ | 37233 | SARA ALBERTSON | a    |
- | 3880 | SARAN HOOK           | a    |
+ | 38382 | SARA CRAMER    | a    |
- | 3980 | GEORGETTA DELROSARIO | a    |
+ | 40067 | SARA QUINTANA  | a    |
- | 4517 | SARAI EASLEY         | a    |
+ | 51593 | SARA RIGGINS   | a    |
- | 5708 | ASA ROSARIO          | a    |
+ | 53815 | SARA WAGNER    | a    |
- | 5731 | SARITA ANDERS        | a    |
+ | 65455 | SARA PAPPAS    | a    |
- | 6100 | CHANTELL SARABIA     | a    |
+ | 81221 | SARA BRILL     | a    |
- | 6165 | SARA HALLMAN         | a    |
+ | 90393 | SARA CURRAN    | a    |
- | 6480 | SARAH NEILL          | a    |
+ | 91455 | SARA BARRAGAN  | a    |
- | 6488 | SARAN PARTIN         | a    |
+ | 92815 | SARA NATHAN    | a    |
- | 6802 | KLARA ROLLER         | a    |
+ | 95651 | SARA AGUILAR   | a    |
- +------+----------------------+------+
+ +-------+----------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT username FROM name WHERE MATCH('SMITH') OPTION cutoff=0, ranker=expr('sum((4*lcs+2*(min_hit_pos=1)+exact_hit)*user_weight)*1000+bm25'), field_weights=(username=1), fuzzy=1;"
––– output –––
- +----------------+
- | username       |
- +----------------+
- | MINH FENNELL   |
- | MINH MAZUR     |
- | MINH VILLEGAS  |
- | MINH TILLER    |
- | MINH VOGT      |
- | MINH SHAW      |
- | MINH STEADMAN  |
- | MINH PEAK      |
- | MINH ROOT      |
- | MINH PATTERSON |
- | MINH BURDETTE  |
- | MINH ABNEY     |
- | MINH DOLAN     |
- | MINH RUDD      |
- | MINH TOLBERT   |
- | MINH CRANDALL  |
- | MINH JAIME     |
- | MINH ISAACSON  |
- | MINH BONILLA   |
- | MINH WAHL      |
- +----------------+
––– input –––
mysql -h0 -P9306 -e "SELECT username FROM name WHERE MATCH('SMITH') OPTION cutoff=0, field_weights=(username=1), fuzzy=1;"
––– output –––
- +-----------------+
- | username        |
- +-----------------+
- | SYDNEY SMYTH    |
- | CHERILYN SMYTH  |
- | SATURNINA SMYTH |
- | LYNN SMYTH      |
- | STEVEN SMYTH    |
- | JASMIN SMYTH    |
- | BERYL SMYTH     |
- | JACK SMYTH      |
- | CAROLEE SMYTH   |
- | CARON SMYTH     |
- | ALFREDO SMYTH   |
- | ALTA SMYTH      |
- | VIKI SMYTH      |
- | CHANA SMYTH     |
- | HYUN SMYTH      |
- | ROGER SMYTH     |
- | LINDSEY SMYTH   |
- | WILFORD SMYTH   |
- | ARLINE SMYTH    |
- | APRYL SMYTH     |
- +-----------------+
––– input –––
mysql -h0 -P9306 -e "SELECT username FROM name WHERE MATCH('SMITH') OPTION cutoff=0, ranker=expr('sum((4*lcs+2*(min_hit_pos=1)+exact_hit)*user_weight)*1000+bm25'), fuzzy=1;"
––– output –––
- +----------------+
- | username       |
- +----------------+
- | MINH FENNELL   |
- | MINH MAZUR     |
- | MINH VILLEGAS  |
- | MINH TILLER    |
- | MINH VOGT      |
- | MINH SHAW      |
- | MINH STEADMAN  |
- | MINH PEAK      |
- | MINH ROOT      |
- | MINH PATTERSON |
- | MINH BURDETTE  |
- | MINH ABNEY     |
- | MINH DOLAN     |
- | MINH RUDD      |
- | MINH TOLBERT   |
- | MINH CRANDALL  |
- | MINH JAIME     |
- | MINH ISAACSON  |
- | MINH BONILLA   |
- | MINH WAHL      |
- +----------------+
––– input –––
mysql -h0 -P9306 -e "SELECT username FROM name WHERE MATCH('SMITH') OPTION cutoff=0, fuzzy=1;"
––– output –––
- +-----------------+
- | username        |
- +-----------------+
- | SYDNEY SMYTH    |
- | CHERILYN SMYTH  |
- | SATURNINA SMYTH |
- | LYNN SMYTH      |
- | STEVEN SMYTH    |
- | JASMIN SMYTH    |
- | BERYL SMYTH     |
- | JACK SMYTH      |
- | CAROLEE SMYTH   |
- | CARON SMYTH     |
- | ALFREDO SMYTH   |
- | ALTA SMYTH      |
- | VIKI SMYTH      |
- | CHANA SMYTH     |
- | HYUN SMYTH      |
- | ROGER SMYTH     |
- | LINDSEY SMYTH   |
- | WILFORD SMYTH   |
- | ARLINE SMYTH    |
- | APRYL SMYTH     |
- +-----------------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('SMITH') ORDER BY id ASC OPTION fuzzy=0;" > /tmp/result_fuzzy0.txt
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('SMITH') ORDER BY id ASC;" > /tmp/result_no_fuzzy.txt
––– output –––
OK
––– input –––
diff /tmp/result_fuzzy0.txt /tmp/result_no_fuzzy.txt; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS fuzziness);" | tail -n +4 | sort
––– output –––
- +--------+
- | joe    |
- | joey   |
- | john   |
- | jon    |
- | jordan |
- | jose   |
- | joseph |
- | joy    |
- | joyce  |
- | major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 'us,ru' AS layouts);" | tail -n +4 | sort
––– output –––
- +--------+
- | joe    |
- | joey   |
- | john   |
- | jon    |
- | jordan |
- | jose   |
- | joseph |
- | joy    |
- | joyce  |
- | major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS append);" | tail -n +4 | sort
––– output –––
- +--------+
- | joe    |
- | joey   |
- | john   |
- | jon    |
- | jordan |
- | jose   |
- | joseph |
- | joy    |
- | joyce  |
- | major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 0 AS prepend);" | tail -n +4 | sort
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS prepend, 1 AS append);" | tail -n +4 | sort
––– output –––
- +--------+
- | joe    |
- | joey   |
- | john   |
- | jon    |
- | jordan |
- | jose   |
- | joseph |
- | joy    |
- | joyce  |
- | major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS fuzziness, '' AS layouts, 1 AS append, 1 AS prepend);" | tail -n +4 | sort
––– output –––
- +--------+
- | joe    |
- | joey   |
- | john   |
- | jon    |
- | jordan |
- | jose   |
- | joseph |
- | joy    |
- | joyce  |
- | major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 2 AS fuzziness, 'us,ru' AS layouts, 1 AS append, 1 AS prepend, 2 AS expansion_len);" | tail -n +4 | sort
––– output –––
- +-------+
- | joe   |
- | joey  |
- | john  |
- | jon   |
- | jose  |
- | joy   |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS append);" | tail -n +4 | sort
––– output –––
- +--------+
- | joe    |
- | joey   |
- | john   |
- | jon    |
- | jordan |
- | jose   |
- | joseph |
- | joy    |
- | joyce  |
- | major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS prepend);" | tail -n +4 | sort
––– output –––
- +--------+
- | joe    |
- | joey   |
- | john   |
- | jon    |
- | jordan |
- | jose   |
- | joseph |
- | joy    |
- | joyce  |
- | major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS append, 1 AS prepend);" | tail -n +4 | sort
––– output –––
- +--------+
- | joe    |
- | joey   |
- | john   |
- | jon    |
- | jordan |
- | jose   |
- | joseph |
- | joy    |
- | joyce  |
- | major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 'us' AS layouts);" | tail -n +4 | sort
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 'ru' AS layouts);" | tail -n +4 | sort
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('al', 'name', 0 AS fuzziness);" | tail -n +4 | sort
––– output –––
- +-----------+
- | albert    |
- | alexander |
- | ali       |
- | dale      |
- | gale      |
- | kendall   |
- | marshall  |
- | palma     |
- | valentine |
- | walter    |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('mi', 'name', 0 AS append, 1 AS prepend);" | tail -n +4 | sort
––– output –––
- +--------+
- | cami   |
- | darci  |
- | joan   |
- | jody   |
- | joe    |
- | joel   |
- | joey   |
- | john   |
- | johnie |
- | johnny |
- | joi    |
- | jon    |
- | jonas  |
- | jordan |
- | jorge  |
- | jose   |
- | joseph |
- | joshi  |
- | joshua |
- | joy    |
- | joyce  |
- | kaci   |
- | kami   |
- | kimi   |
- | laci   |
- | luci   |
- | marci  |
- | mi     |
- | nanci  |
- | naomi  |
- | neomi  |
- | nohemi |
- | ricci  |
- | staci  |
- | tami   |
- | tammi  |
- | tobias |
- | todd   |
- | toi    |
- | tom    |
- | tomas  |
- | tomi   |
- | toney  |
- | traci  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('ch', 'name', 1 AS fuzziness, 3 AS expansion_len);" | tail -n +4 | sort
––– output –––
- +-------+
- | chang |
- | chong |
- | chung |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('зф', 'name', 'us,ru' AS layouts);" | tail -n +4 | sort
––– output –––
- +----------+
- | page     |
- | paige    |
- | palma    |
- | paris    |
- | parker   |
- | pat      |
- | patricia |
- | patrick  |
- | paul     |
- | paz      |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('зф', 'name', 'us' AS layouts);" | tail -n +4 | sort
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('gr', 'name', 1 AS fuzziness, 'ru' AS layouts, 1 AS append, 1 AS prepend);" | tail -n +4 | sort
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "DROP TABLE IF EXISTS tbl1; CREATE TABLE tbl1 (title TEXT) min_infix_len='2';"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM \`tbl1\` WHERE MATCH('abc') OPTION fuzzy = 1;"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "drop table if exists t; create table t(f text) min_infix_len='2'; insert into t values(1, 'something'), (2, 'some thing'); select * from t where match('somethin') option fuzzy=0;"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select * from t where match('somethin') option fuzzy=0;"
––– output –––
OK
––– input –––
mysql -P9306 -h0 -e "drop table if exists t; create table t(f text) min_infix_len='2'; insert into t values(1, 'something'), (2, 'some thing'); call autocomplete('some', 't');"
––– output –––
OK
––– input –––
mysql -P9306 -h0 -e "drop table if exists t; create table t(f text) min_infix_len='2'; insert into t values(1, 'something'), (2, 'some thing'); call autocomplete('some', 't');"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "drop table if exists t; create table t(a int);"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select * from t option fuzzy=1;"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "drop table if exists comment_28798446; create table comment_28798446(id int, content text) min_infix_len='3';"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "insert into comment_28798446 values (1, 'business Manticore interaction'), (2, 'buisness Manticore interation'), (3, 'other text content');"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT id FROM comment_28798446 WHERE MATCH('buisness Manticore interation') OPTION fuzzy = 1, layouts = '';"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT id FROM comment_28798446 WHERE MATCH('business Manticore interaction') OPTION fuzzy = 1, layouts = '';"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT id FROM comment_28798446 WHERE MATCH('Manticore') OPTION fuzzy = 1, layouts = '';"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('bus', 'comment_28798446', 'ru,us,ua' AS layouts);"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('bus', 'comment_28798446', '' AS layouts);"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "drop table if exists t; create table t(f text) min_infix_len='2'; insert into t values(1, 'something'), (2, 'some thing'); select * from t where match('somethin') option fuzzy=0;"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select * from t where match('somethin') option fuzzy=0;"
––– output –––
OK
––– input –––
mysql -P9306 -h0 -e "drop table if exists t; create table t(f text) min_infix_len='2'; insert into t values(1, 'something'), (2, 'some thing'); call autocomplete('some', 't');"
––– output –––
OK
––– input –––
mysql -P9306 -h0 -e "drop table if exists t; create table t(f text) min_infix_len='2'; insert into t values(1, 'something'), (2, 'some thing'); call autocomplete('some', 't');"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "drop table if exists t; create table t(a int);"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select * from t option fuzzy=1;"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "drop table if exists comment_28798446; create table comment_28798446(id int, content text) min_infix_len='3';"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "insert into comment_28798446 values (1, 'business Manticore interaction'), (2, 'buisness Manticore interation'), (3, 'other text content');"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT id FROM comment_28798446 WHERE MATCH('buisness Manticore interation') OPTION fuzzy = 1, layouts = '';"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT id FROM comment_28798446 WHERE MATCH('business Manticore interaction') OPTION fuzzy = 1, layouts = '';"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT id FROM comment_28798446 WHERE MATCH('Manticore') OPTION fuzzy = 1, layouts = '';"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('bus', 'comment_28798446', 'ru,us,ua' AS layouts);"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('bus', 'comment_28798446', '' AS layouts);"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "DROP TABLE IF EXISTS t; DEBUG SLEEP 2; CREATE TABLE t(f TEXT) min_infix_len='2';"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO t VALUES (1, 'abcdef'), (2, 'abcd efgh');"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM t WHERE MATCH('abcdef'); SHOW META;"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "insert into t values(3, 'aa defghi xxx');"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select * from t where match('aa def ghi xxx') option fuzzy=1, layouts='';"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM t WHERE MATCH('abcef') OPTION fuzzy=1; SHOW META;"
––– output –––
OK
––– input –––
grep -A3 "SELECT \* FROM t WHERE MATCH('abcdef')" /var/log/manticore/query.log
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM t WHERE MATCH('nonexistent'); SHOW META;"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM t WHERE MATCH('abcdef') OPTION fuzzy=1;"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM t WHERE MATCH('\$#@\!') OPTION fuzzy=1;"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "DROP TABLE IF EXISTS idx1; CREATE TABLE idx1(value TEXT) min_infix_len='2';"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO idx1(value) VALUES ('340');"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('34', 'idx1');"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('3', 'idx1');"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('34', 'idx1', 1 AS fuzziness);"
––– output –––
OK
––– input –––
echo -e "searchd {\nlisten = 9306:mysql\nlisten = 9312\nlisten = 9308:http\nlog = /tmp/searchd.log\nquery_log = /tmp/query.log\npid_file = /tmp/searchd.pid\n}\n\nsource src_idx {\ntype = tsvpipe\ntsvpipe_command = cat /tmp/data.tsv\ntsvpipe_field_string = f\ntsvpipe_attr_bigint = id\n}\n\nindex idx_plain {\ntype = plain\nsource = src_idx\npath = /tmp/idx_plain\nmin_infix_len = 2\n}" > /tmp/manticore_idx.conf; echo $?
––– output –––
OK
––– input –––
echo -e "1\tabcdef\n2\tabcd efgh\n3\trandom text" > /tmp/data.tsv; echo $?
––– output –––
OK
––– input –––
mkdir -p /tmp/idx_plain && chmod 777 /tmp/idx_plain; echo $?
––– output –––
OK
––– input –––
indexer --all --config /tmp/manticore_idx.conf > /dev/null 2>&1; echo $?
––– output –––
OK
––– input –––
rm -f /tmp/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; (stdbuf -oL searchd -c /tmp/manticore_idx.conf 2>&1 | tee /tmp/searchd.log | grep -i precach & disown); sleep 0.5; if timeout 10 grep -qm1 '\[BUDDY\] started' /tmp/searchd.log; then echo 'Buddy started!'; else echo 'Timeout or failed!'; cat /tmp/searchd.log; fi
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW TABLES;"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW TABLE idx_plain SETTINGS;"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM idx_plain WHERE MATCH('abcdef') OPTION fuzzy=1;"
––– output –––
- +------+-----------+
+ +------+--------+
- | id   | f         |
+ | id   | f      |
- +------+-----------+
+ +------+--------+
- |    1 | abcdef    |
+ |    1 | abcdef |
- |    2 | abcd efgh |
+ +------+--------+
- +------+-----------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM idx_plain WHERE MATCH('abcef') OPTION fuzzy=1;"
––– output –––
- +------+-----------+
- | id   | f         |
- +------+-----------+
- |    1 | abcdef    |
- |    2 | abcd efgh |
- +------+-----------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM idx_plain WHERE MATCH('nonexistent') OPTION fuzzy=1;"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('abc', 'idx_plain');"
––– output –––
- +--------+
- | query  |
- +--------+
- | abcd   |
- | abcdef |
- +--------+
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('ran', 'idx_plain');"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('zzz', 'idx_plain');"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM idx_plain WHERE MATCH('abcdef') OPTION fuzzy=0;"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM idx_plain WHERE MATCH('abcd efgh') OPTION fuzzy=0;"
––– output –––
OK
test/clt-tests/buddy-plugins/test-fuzzy-autocomplete-http.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd $SEARCHD_FLAGS > /dev/null; 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 –––
OK
––– input –––
apt-get update -y > /dev/null; echo $?
––– output –––
OK
––– input –––
apt-get install jq -y > /dev/null; echo $?
––– output –––
OK
––– input –––
php -d memory_limit=2G ./test/clt-tests/scripts/load_names_attr.php --batch-size=100000 --concurrency=1 --docs=1000000 --start-id=1 --min-infix-len=2 > /dev/null; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name ORDER BY id ASC LIMIT 1000000 OPTION max_matches=1000000;" > /tmp/name_data.txt
––– output –––
OK
––– input –––
md5sum /tmp/name_data.txt
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE name;" | grep "min_infix_len='2'" | sed "s/.\(min_infix_len='2'\)./\1/"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT COUNT(*) FROM name;"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "OPTIMIZE TABLE name OPTION sync=1;"
––– output –––
OK
––– input –––
curl -sX POST http://localhost:9308/search -d '{"index":"name","query":{"bool":{"must":[{"match":{"*":"EBGRNA"}}]}},"options":{"fuzzy":true}}' | jq -r '.hits.hits[]._source.username'
––– output –––
- BERNA PFEIFFER
- BERNA SAGE
- BERNA PANG
- BERNA STOLTZFUS
- BERNA HALVERSON
- BERNA PLASCENCIA
- BERNA CALLAWAY
- BERNA STONER
- BERNA MARSH
- BERNA LEI
- BERNA SOUSA
- BERNA LIAO
- BERNA TROTTER
- BERNA VALDOVINOS
- BERNA VALLE
- BERNA ELKINS
- BERNA HURD
- BERNA DUARTE
- BERNA HAUGEN
- BERNA LISTER
––– input –––
curl -sX POST http://localhost:9308/search -d '{"index":"name","query":{"bool":{"must":[{"match":{"*":"ANT"}}]}},"options":{"fuzzy":true}}' | jq -r '.hits.hits[]._source.username'
––– output –––
- SHANE GANT
- DANILLE GANT
- BLANCH GANT
- TRISTAN GANT
- NATHANAEL GANT
- JANESSA GANT
- ANDREW GANT
- KORTNEY GANT
- SABINE GANT
- IRA GANT
- SHAWNTA GANT
- TRACEY GANT
- JIM GANT
- GERRY GANT
- ELROY GANT
- ERIN GANT
- LEONARDA GANT
- JARED GANT
- RODNEY GANT
- ROCKY GANT
––– input –––
curl -sX POST http://localhost:9308/search -d '{"index":"name","query":{"bool":{"must":[{"match":{"*":"tony"}}]}},"options":{"fuzzy":true}}' | jq -M
––– output –––
{
  "took": %{NUMBER},
  "timed_out": false,
  "hits": {
-     "total": 1813,
+     "total": 353,
    "total_relation": "eq",
    "hits": [
      {
-         "_id": 800363,
+         "_id": 801407,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY BEAULIEU",
+           "username": "TONY KERSEY",
          "s": "a"
        }
      },
      {
-         "_id": 807095,
+         "_id": 802954,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY HOFER",
+           "username": "TONY JACOBSON",
          "s": "a"
        }
      },
      {
-         "_id": 807096,
+         "_id": 804215,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY DEMPSEY",
+           "username": "TONY WILLIS",
          "s": "a"
        }
      },
      {
-         "_id": 808820,
+         "_id": 807893,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY RAYMOND",
+           "username": "TONY TREMBLAY",
          "s": "a"
        }
      },
      {
-         "_id": 808863,
+         "_id": 809344,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY BATEMAN",
+           "username": "TONY CONNORS",
          "s": "a"
        }
      },
      {
-         "_id": 813761,
+         "_id": 810439,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY VANWINKLE",
+           "username": "TONY GODINEZ",
          "s": "a"
        }
      },
      {
-         "_id": 818229,
+         "_id": 811284,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY BROCK",
+           "username": "TONY ATWOOD",
          "s": "a"
        }
      },
      {
-         "_id": 825472,
+         "_id": 822885,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY LINDQUIST",
+           "username": "TONY ACKERMAN",
          "s": "a"
        }
      },
      {
-         "_id": 826251,
+         "_id": 831416,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY KAUFFMAN",
+           "username": "TONY HERRINGTON",
          "s": "a"
        }
      },
      {
-         "_id": 827886,
+         "_id": 833357,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY PITMAN",
+           "username": "TONY HYLAND",
          "s": "a"
        }
      },
      {
-         "_id": 832558,
+         "_id": 833493,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY KELLEY",
+           "username": "TONY SAUNDERS",
          "s": "a"
        }
      },
      {
-         "_id": 833689,
+         "_id": 834620,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY HANDY",
+           "username": "TONY CROCKETT",
          "s": "a"
        }
      },
      {
-         "_id": 834136,
+         "_id": 837319,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY HOPPE",
+           "username": "TONY WEINER",
          "s": "a"
        }
      },
      {
-         "_id": 836413,
+         "_id": 838630,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY STOVALL",
+           "username": "TONY IBANEZ",
          "s": "a"
        }
      },
      {
-         "_id": 839075,
+         "_id": 840247,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY JEROME",
+           "username": "TONY HAMBY",
          "s": "a"
        }
      },
      {
-         "_id": 839512,
+         "_id": 842966,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY LEONARD",
+           "username": "TONY MURDOCK",
          "s": "a"
        }
      },
      {
-         "_id": 841923,
+         "_id": 846296,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY PARNELL",
+           "username": "TONY BUSH",
          "s": "a"
        }
      },
      {
-         "_id": 842450,
+         "_id": 852863,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY LOWE",
+           "username": "TONY DELAGARZA",
          "s": "a"
        }
      },
      {
-         "_id": 843217,
+         "_id": 853630,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY ROBISON",
+           "username": "TONY KRIEGER",
          "s": "a"
        }
      },
      {
-         "_id": 846291,
+         "_id": 857623,
-         "_score": 1547,
+         "_score": 1644,
        "_source": {
-           "username": "TOBY BITTNER",
+           "username": "TONY GAYTAN",
          "s": "a"
        }
      }
    ]
  }
}
––– input –––
curl -sX POST http://localhost:9308/search -d '{"index":"name","query":{"bool":{"must":[{"match":{"*":"SMITH"}}]}}, "sort":[{"id":"desc"},{"username":"asc"}], "options":{"fuzzy":true}}' | jq -M
––– output –––
{
  "took": %{NUMBER},
  "timed_out": false,
  "hits": {
-     "total": 1304,
+     "total": 0,
    "total_relation": "eq",
-     "hits": [
+     "hits": []
-       {
+   }
-         "_id": 999737,
+ }
-         "_score": 1,
-         "_source": {
-           "username": "KEITH STUMP",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 999039,
-         "_score": 1,
-         "_source": {
-           "username": "KEITH JAMIESON",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 996439,
-         "_score": 1,
-         "_source": {
-           "username": "KEITHA CARBAJAL",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 995770,
-         "_score": 1,
-         "_source": {
-           "username": "KEITH GONZALES",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 990882,
-         "_score": 1,
-         "_source": {
-           "username": "MINH SANTANA",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 990643,
-         "_score": 1,
-         "_source": {
-           "username": "KEITH MENDES",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 989972,
-         "_score": 1,
-         "_source": {
-           "username": "KEITHA WALTERS",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 989954,
-         "_score": 1,
-         "_source": {
-           "username": "GWENN SMYTH",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 989444,
-         "_score": 1,
-         "_source": {
-           "username": "KEITH KEATON",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 988755,
-         "_score": 1,
-         "_source": {
-           "username": "SHERRON SMYTH",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 988366,
-         "_score": 1,
-         "_source": {
-           "username": "LAVONIA SMYTH",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 988254,
-         "_score": 1,
-         "_source": {
-           "username": "MAYOLA KEITH",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 987106,
-         "_score": 1,
-         "_source": {
-           "username": "KEITH FAULK",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 986580,
-         "_score": 1,
-         "_source": {
-           "username": "DARNELL SMYTH",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 984012,
-         "_score": 1,
-         "_source": {
-           "username": "KEITH CORONEL",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 982759,
-         "_score": 1,
-         "_source": {
-           "username": "MORGAN KEITH",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 982421,
-         "_score": 1,
-         "_source": {
-           "username": "KEITH SHIFFLETT",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 982223,
-         "_score": 1,
-         "_source": {
-           "username": "TELMA KEITH",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 982056,
-         "_score": 1,
-         "_source": {
-           "username": "RENITA KEITH",
-           "s": "a"
-         }
-       },
-       {
-         "_id": 981115,
-         "_score": 1,
-         "_source": {
-           "username": "KATIE SMYTH",
-           "s": "a"
-         }
-       }
-     ]
-   }
- }
––– input –––
curl -sX POST http://localhost:9308/search -d '{"index":"name","query":{"bool":{"must":[{"match":{"*":"SMYTH"}}]}}, "sort":[{"id":"desc"},{"username":"asc"}], "options":{"fuzzy":true}}' | jq -M
––– output –––
{
  "took": %{NUMBER},
  "timed_out": false,
  "hits": {
-     "total": 773,
+     "total": 216,
    "total_relation": "eq",
    "hits": [
      {
-         "_id": 998829,
+         "_id": 989954,
        "_score": 1,
        "_source": {
-           "username": "EDYTHE VACA",
+           "username": "GWENN SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 998500,
+         "_id": 988755,
        "_score": 1,
        "_source": {
-           "username": "SETH PHUNG",
+           "username": "SHERRON SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 996507,
+         "_id": 988366,
        "_score": 1,
        "_source": {
-           "username": "SETH LYMAN",
+           "username": "LAVONIA SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 995119,
+         "_id": 986580,
        "_score": 1,
        "_source": {
-           "username": "EDYTHE JOHN",
+           "username": "DARNELL SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 993455,
+         "_id": 981115,
        "_score": 1,
        "_source": {
-           "username": "EDYTH ROSADO",
+           "username": "KATIE SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 992097,
+         "_id": 975841,
        "_score": 1,
        "_source": {
-           "username": "EDYTH RAGAN",
+           "username": "ALEIDA SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 989954,
+         "_id": 974429,
        "_score": 1,
        "_source": {
-           "username": "GWENN SMYTH",
+           "username": "DEMETRIA SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 988823,
+         "_id": 973985,
        "_score": 1,
        "_source": {
-           "username": "SETH WHITTAKER",
+           "username": "LOGAN SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 988755,
+         "_id": 969183,
        "_score": 1,
        "_source": {
-           "username": "SHERRON SMYTH",
+           "username": "SCOTTY SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 988366,
+         "_id": 960037,
        "_score": 1,
        "_source": {
-           "username": "LAVONIA SMYTH",
+           "username": "EDGAR SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 986580,
+         "_id": 958857,
        "_score": 1,
        "_source": {
-           "username": "DARNELL SMYTH",
+           "username": "MIRTHA SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 986231,
+         "_id": 957495,
        "_score": 1,
        "_source": {
-           "username": "EDYTH BLODGETT",
+           "username": "SIXTA SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 985595,
+         "_id": 953233,
        "_score": 1,
        "_source": {
-           "username": "SETH BACON",
+           "username": "LAWRENCE SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 982423,
+         "_id": 951184,
        "_score": 1,
        "_source": {
-           "username": "SETH CHATMAN",
+           "username": "WILDA SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 981115,
+         "_id": 944283,
        "_score": 1,
        "_source": {
-           "username": "KATIE SMYTH",
+           "username": "HONG SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 979541,
+         "_id": 936733,
        "_score": 1,
        "_source": {
-           "username": "EDYTHE CLAYTON",
+           "username": "BEV SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 979093,
+         "_id": 935940,
        "_score": 1,
        "_source": {
-           "username": "SETH BURROUGHS",
+           "username": "CRISTY SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 978812,
+         "_id": 929866,
        "_score": 1,
        "_source": {
-           "username": "EDYTH GULLEY",
+           "username": "TEQUILA SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 975994,
+         "_id": 915866,
        "_score": 1,
        "_source": {
-           "username": "SETH PARHAM",
+           "username": "AMANDA SMYTH",
          "s": "a"
        }
      },
      {
-         "_id": 975841,
+         "_id": 908615,
        "_score": 1,
        "_source": {
-           "username": "ALEIDA SMYTH",
+           "username": "AMBERLY SMYTH",
          "s": "a"
        }
      }
    ]
  }
}
––– input –––
curl -sX POST http://localhost:9308/autocomplete -d '{"table":"name","query":"jo","options":{"layouts":"us,ru"}}' | jq -M
––– output –––
[
  {
-     "total": 10,
+     "total": 0,
    "error": "",
    "warning": "",
    "columns": [
      {
        "query": {
          "type": "string"
        }
      }
-     ],
+     ]
-     "data": [
+   }
-       {
+ ]
-         "query": "jordan"
-       },
-       {
-         "query": "joseph"
-       },
-       {
-         "query": "jose"
-       },
-       {
-         "query": "joe"
-       },
-       {
-         "query": "john"
-       },
-       {
-         "query": "joy"
-       },
-       {
-         "query": "joyce"
-       },
-       {
-         "query": "joey"
-       },
-       {
-         "query": "jon"
-       },
-       {
-         "query": "major"
-       }
-     ]
-   }
- ]
––– input –––
curl -sX POST http://localhost:9308/autocomplete -d '{"table":"name","query":"jo","options":{"append":1}}' | jq -M
––– output –––
[
  {
-     "total": 10,
+     "total": 0,
    "error": "",
    "warning": "",
    "columns": [
      {
        "query": {
          "type": "string"
        }
      }
-     ],
+     ]
-     "data": [
+   }
-       {
+ ]
-         "query": "jordan"
-       },
-       {
-         "query": "joseph"
-       },
-       {
-         "query": "jose"
-       },
-       {
-         "query": "joe"
-       },
-       {
-         "query": "john"
-       },
-       {
-         "query": "joy"
-       },
-       {
-         "query": "joyce"
-       },
-       {
-         "query": "joey"
-       },
-       {
-         "query": "jon"
-       },
-       {
-         "query": "major"
-       }
-     ]
-   }
- ]
––– input –––
curl -sX POST http://localhost:9308/autocomplete -d '{"table":"name","query":"jo","options":{"prepend":0}}' | jq -M
––– output –––
OK
––– input –––
curl -sX POST http://localhost:9308/autocomplete -d '{"table":"name","query":"jo","options":{"prepend":1,"append":1}}' | jq -M
––– output –––
[
  {
-     "total": 10,
+     "total": 0,
    "error": "",
    "warning": "",
    "columns": [
      {
        "query": {
          "type": "string"
        }
      }
-     ],
+     ]
-     "data": [
+   }
-       {
+ ]
-         "query": "jordan"
-       },
-       {
-         "query": "joseph"
-       },
-       {
-         "query": "jose"
-       },
-       {
-         "query": "joe"
-       },
-       {
-         "query": "john"
-       },
-       {
-         "query": "joy"
-       },
-       {
-         "query": "joyce"
-       },
-       {
-         "query": "joey"
-       },
-       {
-         "query": "jon"
-       },
-       {
-         "query": "major"
-       }
-     ]
-   }
- ]
––– input –––
curl -sX POST http://localhost:9308/autocomplete -d '{"table":"name","query":"jo","options":{"fuzziness":1,"layouts":"","append":1,"prepend":1}}' | jq -M
––– output –––
[
  {
-     "total": 10,
+     "total": 0,
    "error": "",
    "warning": "",
    "columns": [
      {
        "query": {
          "type": "string"
        }
      }
-     ],
+     ]
-     "data": [
+   }
-       {
+ ]
-         "query": "jordan"
-       },
-       {
-         "query": "joseph"
-       },
-       {
-         "query": "jose"
-       },
-       {
-         "query": "joe"
-       },
-       {
-         "query": "john"
-       },
-       {
-         "query": "joy"
-       },
-       {
-         "query": "joyce"
-       },
-       {
-         "query": "joey"
-       },
-       {
-         "query": "jon"
-       },
-       {
-         "query": "major"
-       }
-     ]
-   }
- ]
––– input –––
curl -sX POST http://localhost:9308/autocomplete -d '{"table":"name","query":"jo","options":{"fuzziness":2,"layouts":"us,ru","append":1,"prepend":1,"expansion_len":2}}' | jq -M
––– output –––
[
  {
-     "total": 6,
+     "total": 0,
    "error": "",
    "warning": "",
    "columns": [
      {
        "query": {
          "type": "string"
        }
      }
-     ],
+     ]
-     "data": [
+   }
-       {
+ ]
-         "query": "jose"
-       },
-       {
-         "query": "joe"
-       },
-       {
-         "query": "john"
-       },
-       {
-         "query": "joy"
-       },
-       {
-         "query": "joey"
-       },
-       {
-         "query": "jon"
-       }
-     ]
-   }
- ]
––– input –––
curl -sX POST http://localhost:9308/autocomplete -d '{"table":"name","query":"gr","options":{"fuzziness":1,"layouts":"ru","append":1,"prepend":1}}' | jq -M
––– output –––
OK

@github-actions
Copy link
Contributor

github-actions bot commented Nov 25, 2025

Windows test results

    3 files      3 suites   29m 53s ⏱️
1 115 tests 1 061 ✅ 54 💤 0 ❌
1 117 runs  1 063 ✅ 54 💤 0 ❌

Results for commit 656f5db.

♻️ This comment has been updated with latest results.

@sanikolaev
Copy link
Collaborator Author

RAM use stats for the current branch compared to the master branch:
image

The command used for the test is:

manticore-load --port=9306 --drop --batch-size=1 --threads=5 --total=100000 --init="CREATE TABLE t(f text) min_infix_len='2'" --load="INSERT INTO t(f) values('<string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42>')";

@sanikolaev
Copy link
Collaborator Author

Another test with more typical token (English dictionary words), which also includes waiting for the table to finish optimizing:

wget -O words.txt https://raw.githubusercontent.com/dwyl/english-words/refs/heads/master/words.txt
grep -v "\/" words.txt > words.sanitized.txt

cmake --build . && ./src/searchd --stopwait; ./src/searchd; sleep 3; manticore-load \
--drop \
--batch-size=1000 \
--threads=8 \
--total=200000 \
--init="CREATE TABLE test(name text)" \
--load="INSERT INTO test(name) VALUES('<text/{words.txt}/1000/1000>')" \
--wait
image

Radix:

Process 1 final statistics:
Init command:     CREATE TABLE test(name text)
Load command:     INSERT INTO test(name) VALUES('<text/{words.txt}/1000/1000>')
Total time:       02:25
Total queries:    200
Threads:          8
Batch size:       1000
Total docs:       200000
Docs per sec avg: 1377
QPS avg:          1
QPS 1p:           0
QPS 5p:           0
QPS 95p:          3
QPS 99p:          5
Latency avg:      4209.7 ms
Latency 50p:      4150.0 ms
Latency 95p:      4750.0 ms
Latency 99p:      5150.0 ms

Master:

Process 1 final statistics:
Init command:     CREATE TABLE test(name text)
Load command:     INSERT INTO test(name) VALUES('<text/{words.txt}/1000/1000>')
Total time:       02:18
Total queries:    200
Threads:          8
Batch size:       1000
Total docs:       200000
Docs per sec avg: 1440
QPS avg:          1
QPS 1p:           0
QPS 5p:           0
QPS 95p:          4
QPS 99p:          6
Latency avg:      4106.5 ms
Latency 50p:      3950.0 ms
Latency 95p:      4550.0 ms
Latency 99p:      5250.0 ms

@sanikolaev sanikolaev removed the pack To trigger CI to build packages for PR label Nov 27, 2025
@sanikolaev
Copy link
Collaborator Author

Another test that merges long chunks made up of many random string which causes lots of infixes.

cmake --build . && ./src/searchd --stopwait; ./src/searchd; sleep 3; ~/searchd_anon_mem.sh | tee /tmp/$(git rev-parse --abbrev-ref HEAD) &; manticore-load --port=9306 --drop --batch-size=1 --threads=5 --total=60000 --init="CREATE TABLE t(f text) min_infix_len='2'" --load="INSERT INTO t(f) values('<string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42> <string/42/42>')"; echo "optimizing" >> /tmp/$(git rev-parse --abbrev-ref HEAD); mysql -P9306 -h0 -e "optimize table t option sync=1, cutoff=1"; kill %1
image

@sanikolaev
Copy link
Collaborator Author

As discussed:

  • we should use gtest for the radix sort to make sure the output infixes stay the same
  • it may be useful to keep the arena size at 1M by default and allow it to be changed
  • instead of using the C++ standard integer types, we should use our own names (word, short, etc.)
  • this test needs to be redone to make sure the new algorithm doesn’t slow things down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants