Here's some Nim Forum modifications, primarily a full-text search is added - https://github.com/nimrod-code/nimforum/pull/28.
The test version is now run at http://moy-server.ru:9000.
INSTALL NOTES:
Compiles with precompiled binaries (from the site, not new devel/bigbreak) (Jester doesn't compile with bigbreak, issues with AsyncHTTPServer, {.locks.} and {.gcsafe.}.
The search requires an SQLite dll with FTS4 (Full Text Search 4) support. The dll can be compiled in 2 variants - with Simple or Enhanced syntax for grouping operations (logical operators and parentheses), the latter is better foe use (maybe a little more consumtive for the server).
createdb.nim needs to be recompiled and run once before Forum launching (it'll reindex the Forum content after creating FTS tables; existing tables are not touched, though backup is never out of place :)).
If there is some another version of Nim Forum you are now working on - I can make the same changes there as well. The changes don't touch the way Forum or Jester work inside, so they may work with new_async or something. Fully functional forum may be a good example of Nim facilities and for now this forum is the most visible to people real usage example of Nim.
If some issues occur while compiling / installing or something should be done - you can address me any time (in this forum or by e-mail in my account), I'll be glad to contribute. I really like this forum much and want it to be self-contained (not depended on something). If there are needed some other web-related contributions (either with the forum or the site) - don't hesitate to contact me.
So I hope you change your mind. )
FTS4 is official SQLite's full-text search engine. Last time I've downloaded SQLite's binary from it's official site, FTS4 was included (with Simple set operations syntax included). I can make search without it, and it may be much simpler, but it would VERY resource-consumtive (all the data read for every search query). An own search engine such as SQLite's FTS can be developed too, but it's much work. SQLite's FTS is a ready production-quality solution, and it's not much more dependency than SQLite server itself (you use it's library anyway).
There are some other changes in that commit. Page numbering is improved (fewer links, ellipsis, number-input element).
Reconstructed the search on new_async - http://moy-server.ru:5000. It took not much effort, main logic is implemented in a separate SQL file, and other things are not affected by low-level details.
Templates/CSS took the most of time, so most likely there is something to touch up. Waiting for comments.
Is there a way to detect the presence of FTS at runtime?
I think just to query existance of FTS tables, that are to be created once at install time with createdb.nim (the utility that creates all the tables for Forum), I can make such a test. Just in case, FTS is included in the usual source distributive of SQLite (as well as in some binaries), it just needs 2 extra compiler directives on the command line: -DSQLITE_ENABLE_FTS3 and -DSQLITE_ENABLE_FTS3_PARENTHESIS. https://sqlite.org/fts3.html#section_2. There is a one-file source (all modules merged to 1 C file) - https://sqlite.org/amalgamation.html.
jgoodgive: thanks )
UPD
On the test server (link above) I've set to display 2 threads per page, 3 posts per page in threads, and in navigation (page numbers) up to 2 links to the each side of the current one - it's for testing purposes, because of lack of content. Real settings are 15, 10 and 8 respectively.
Thank you Leu-Gim. The search works very well. I merged your PR and made some further changes. In particular I removed the pagenum jump form and I changed the direct post links.
Here is the latest forum: http://178.62.143.63:5000/. I'll keep it running for a while, it would be awesome if you guys could test it and tell me if there are any issues.
Wow the updated forum looks great!
(even though the rest of the site looks a bit gaudy for my taste ;))