1
0
Fork 0
mirror of https://libwebsockets.org/repo/libwebsockets synced 2025-08-28 11:10:11 +00:00
libwebsockets/minimal-examples-lowlevel/api-tests/api-test-fts
Andy Green 47efb8c1c2 cmake: set minimum to 3.10
CMake is continually deprecating old cmake, such that if we don't try to
keep up with its minimum version there are warnings or eventually failures
to build.  Windows vcpkg has latest 4.03 which prints warning messages if
your CMakeLists.txt has a VERSION < 3.10.  So let's upgrade all the
CMakeLists.txt to that as the minimum.
2025-06-19 14:48:23 +01:00
..
canned-1.txt examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
canned-2.txt examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
CMakeLists.txt cmake: set minimum to 3.10 2025-06-19 14:48:23 +01:00
les-mis-utf8.txt examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
main.c examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
README.md examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
the-picture-of-dorian-gray.txt examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00

lws api test fts

Demonstrates how to create indexes and perform full-text searches.

build

 $ cmake . && make

usage

Commandline option Meaning
-d Debug verbosity in decimal, eg, -d15
-c / --createindex Create an index file, instead of searching
-i / --index Use this file as the index

The two modes are:

  • create an index: --createindex inputfile [inputfile...]
 $ ./lws-api-test-fts -c ./the-picture-of-dorian-gray.txt
[2018/10/15 07:14:15:1175] USER: LWS API selftest: full-text search
[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 
  • perform search[es]: searchterm [searchterm...]
 $ ./lws-api-test-fts b
[2018/10/15 07:15:44:1442] USER: LWS API selftest: full-text search 
[2018/10/15 07:15:44:1442] NOTICE: lws_fts_search: 'b' Matched: 3 instances, 8 children, 0ms
[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC b: 3 agg hits
[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC be: 472 agg hits
[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC bee: 3 agg hits
[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC been: 236 agg hits
[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC beaut: 1 agg hits
[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC beauty: 55 agg hits
[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC because: 40 agg hits
[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC believe: 49 agg hits
[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC better: 54 agg hits
[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC before: 75 agg hits
[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC beg: 5 agg hits
[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC began: 44 agg hits
[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC but: 401 agg hits
[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC basil: 158 agg hits
[2018/10/15 07:15:44:1443] NOTICE: lws_fts_results_dump: AC broke: 22 agg hits
[2018/10/15 07:15:44:1444] NOTICE: lws_fts_results_dump: AC by: 242 agg hits
[2018/10/15 07:15:44:1444] NOTICE: lws_fts_results_dump: AC boy: 36 agg hits