• Home
Name Date Size #Lines LOC

..--

CMakeLists.txtD03-May-20242 KiB7869

README.mdD03-May-20242.2 KiB5442

canned-1.txtD03-May-2024500 2723

canned-2.txtD03-May-2024439 4339

les-mis-utf8.txtD03-May-2024693.8 KiB14,40011,109

main.cD03-May-20244.5 KiB231167

selftest.shD03-May-20241.6 KiB5923

the-picture-of-dorian-gray.txtD03-May-2024451.2 KiB8,9057,240

README.md

1# lws api test fts
2
3Demonstrates how to create indexes and perform full-text searches.
4
5## build
6
7```
8 $ cmake . && make
9```
10
11## usage
12
13Commandline option|Meaning
14---|---
15-d <loglevel>|Debug verbosity in decimal, eg, -d15
16-c / --createindex|Create an index file, instead of searching
17-i / --index <file>|Use this file as the index
18
19The two modes are:
20
21 - create an index: `--createindex inputfile [inputfile...]`
22
23```
24 $ ./lws-api-test-fts -c ./the-picture-of-dorian-gray.txt
25[2018/10/15 07:14:15:1175] USER: LWS API selftest: full-text search
26[2018/10/15 07:14:15:1531] NOTICE: lws_fts_serialize: index 1 files (0MiB) cpu time 32ms, alloc: 1024KiB + 1024KiB, serialize: 3ms, file: 325KiB
27```
28
29 - perform search[es]: `searchterm [searchterm...]`
30
31```
32 $ ./lws-api-test-fts b
33[2018/10/15 07:15:44:1442] USER: LWS API selftest: full-text search
34[2018/10/15 07:15:44:1442] NOTICE: lws_fts_search: 'b' Matched: 3 instances, 8 children, 0ms
35[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC b: 3 agg hits
36[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC be: 472 agg hits
37[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC bee: 3 agg hits
38[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC been: 236 agg hits
39[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC beaut: 1 agg hits
40[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC beauty: 55 agg hits
41[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC because: 40 agg hits
42[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC believe: 49 agg hits
43[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC better: 54 agg hits
44[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC before: 75 agg hits
45[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC beg: 5 agg hits
46[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC began: 44 agg hits
47[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC but: 401 agg hits
48[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC basil: 158 agg hits
49[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC broke: 22 agg hits
50[2018/10/15 07:15:44:1444] NOTICE: lws_fts_results_dump: AC by: 242 agg hits
51[2018/10/15 07:15:44:1444] NOTICE: lws_fts_results_dump: AC boy: 36 agg hits
52```
53
54