A private, self-hosted search engine for Simple Machines Forum (SMF): posts, PDFs, text files, images, video and audio, all from the forum's own search dropdown.
Built for drugs-and-users.org by Andrew Egerszegi ("Chip"), with Claude.ai, ChatGPT and Gemini. Nothing leaves your server: no Google, no outside search service. Your forum is indexed by your forum.
#do-not-indexISE adds five entries to the search-engine dropdown that the CustomSearch mod provides, next to the usual Default / Google / Yandex / Nigma choices:
| Dropdown | Searches | Built by |
|---|---|---|
| ISE | Post bodies and subjects across the whole forum, through ISE's own word index (not SMF's built-in search) | IndexBuilder.py |
| ISEpdf | Text inside PDF attachments, plus each PDF's file name and its topic subject. A result opens the PDF viewer at the matching page | PDFIndexer.py |
| ISEmisc | Text attachments: full content of .md .txt .text .json .html and other plain-text files; code and config files (.py .php .js .sh โฆ) by file name and type |
MiscIndexer.py |
| ISEmedia | Images, video and audio, by file name, post subject, AI-written captions of pictures and video frames, audio tags, and the speech in videos. Audio can also be filtered by tempo and musical key | MediaIndexer.py, MediaProcessor.py, AudioProcessor.py, MediaTranscriber.py |
| ISEmega | ISE + ISEpdf + ISEmisc at once, merged onto one page (ISEmedia is not included, despite the name) | the three above |
Under the hood, the post search is a pure-Python pipeline:
QueryParser โ Tokeniser โ ANDMatcher โ RankingEngine โ ResultFormatter
Searches run against pre-built JSON indexes in ISE_Data/, not against the live database, so they are fast, and they only know what was there when the index was last built (see cron).
ISEmedia loads no AI model at search time. All the AI work happens when the indexes are built: CLIP (a model that compares pictures with text) for image vectors, a small vision model for captions, CLAP (CLIP's audio counterpart) for audio tags, and a speech model for video transcripts.
/sort use-OR relaxes it to any word."double quotes".* and ?) on file names and subjects in ISEpdf, ISEmisc and ISEmedia./sort newest | oldest | newmod | oldmod.bpm:124, key:Am. Long DJ mixes match by any 30-second stretch, and the card tells you where./help in any ISE search box..htaccess.#do-not-index: moderators can keep a post, and all its attachments, out of every index.| Type this | What happens | Works in |
|---|---|---|
word1 word2 |
Every word must match (AND). Plain words ignore letter case | all five |
"an exact phrase" |
Exact phrase, spacing and punctuation as typed. Case-sensitive in ISE and ISEmisc; case-independent in ISEpdf | ISE, ISEpdf, ISEmisc |
claude.ai |
A word with punctuation in it is matched as that exact string | ISE |
*.mp3 ยท sensuous* ยท *chem* |
Wildcards on names. A term with * or ? is matched against the whole name, so add your own * at either end |
ISEpdf, ISEmisc, ISEmedia |
/sort newest ยท /sort oldest |
Order by date posted | all five |
/sort newmod ยท /sort oldmod |
Order by date last edited (falls back to date posted) | ISE only |
/sort use-OR |
Any word may match instead of every word | all five |
bpm:124 ยท bpm:122-126 |
Audio tempo in beats per minute. A whole number means ยฑ1.5 | ISEmedia |
key:Am ยท key:F# ยท key:Gb-major |
Musical key. A bare note (key:A) matches major or minor; flats are read as their sharp |
ISEmedia |
/help |
Opens the "How search works" page | all five |
Result caps: ISEmega and ISEmedia draw at most 180 result cards and show a "Show all" link when there are more. Everything is still searched and ranked in full. ISE, ISEpdf and ISEmisc have no cap.
Known gaps:
'single quotes'are not treated as a phrase in ISE (posts), and ISE (posts) has no wildcards yet.
SMF 2.0 to 2.0.19
These three mods, installed in this order before ISE. All three are in Required SMF Mods/:
ISE's installer checks for all three by name and stops cleanly if one is missing.
For ISEmedia: the Collaborative mod (v6.5, in Suggested SMF Mods/). It installs the shared Collabware/ library that the media scripts import (Collabware/core_utils.py). Since v9.1 the ISE text viewer and media player also live in that library.
| Interpreter | Runs | Needs |
|---|---|---|
python3 (3.6+) |
Post, PDF and text search and indexing: search.py, PDFsearch.py, MiscSearch.py, MegaSearch.py, IndexBuilder.py, PDFIndexer.py, MiscIndexer.py, orphan_check.py, pdf_duplicate_spotter.py |
pymysql, mysql-connector-python, PyMuPDF, pypdf |
python3.8 |
ISEmedia: MediaIndexer.py, MediaProcessor.py, MediaSearch.py, AudioProcessor.py, MediaTranscriber.py |
numpy, torch, open_clip, transformers (audio) |
pip install --upgrade move them without re-testing: pymupdf==1.19.2 (later versions have no 3.6 build) and pypdf==3.1.0 (5.x crashes on import before Python 3.8).python3.8, never bare python3; under the wrong interpreter they fail on import numpy / import torch before doing anything. Over SSH use the full path /usr/local/bin/python3.8 if sudo can't find it. The ISEmedia web bridge finds python3.8 by itself.llama-mtmd-cli, only if you want image/video captions (SmolVLM model) or speech-to-text (Qwen3-ASR model).AudioProcessor.py is designed to run on a separate machine and refuses to run on any other host unless given --any-host; push its audio_store.json to the forum server afterwards.ISE_v10.5.zip through SMF's Package Manager. The installer:
The_ISE_Project/, ISE_Data/ and pdfjs/ into the forum root with 777 permissions;IndexBuilder.py, PDFIndexer.py, MiscIndexer.py and MediaIndexer.py in the background, so the install returns at once. Each writes its own log in ISE_Data/;ISE_Data/hf_cache (the CLIP model cache) if it's empty.$boarddir/pdfjs. If you had ln links pointing at an older $themedir/pdfjs, re-point them.To build or rebuild an index by hand:
cd /path/to/webroot/The_ISE_Project
python3 IndexBuilder.py --monitor # posts โ word_index.json, post_store.json
python3 PDFIndexer.py --monitor # PDFs โ word_index_pdf.json, pdf_store.json
python3 MiscIndexer.py --monitor # text files โ word_index_misc.json, misc_store.json
python3.8 MediaIndexer.py --verbose --monitor # media โ media_store.json
python3.8 MediaProcessor.py --ft=image --progress # captions + CLIP vectors for new images (and --ft=video)
IndexBuilder.py and MiscIndexer.py rebuild from scratch every run, so they're always safe to re-run. PDFIndexer.py resumes by default and only adds PDFs it hasn't seen (--fastest for new files only, --fresh for a full rebuild).
Two files in the package hold the suggested schedules:
crontab_system_additions โ append to /etc/crontab, then restart cron (on CentOS: service crond restart).crontab_apache_additions โ add to the apache user's crontab with crontab -u apache -e.| When | Job |
|---|---|
| Every hour, :07 | MediaIndexer.py โ catalogue new images, video and audio |
| Every hour, :23 | cleanISE_Clone --apply โ tidy temporary files, oversized logs and stale locks (media-processing machine) |
| Every 2 hours, :00 | IndexBuilder.py โ rebuild the post index |
| Every 2 hours, :30 | MiscIndexer.py โ rebuild the text-attachment index |
| Every 6 hours, :05 | PDFIndexer.py --fast โ quick PDF pass (PyMuPDF only) |
| Every 2 days, 00:10 | PDFIndexer.py โ thorough PDF pass with both extractors (resumes; not a rebuild) |
| Every 12 hours, :15 | attach_filetypes.sh โ report on every attachment by file type |
| Mondays, 06:00 | orphan_check.py โ attachments with no post, logged only when something is new |
| Daily, 00:00 and 05:00 | query_log_reader.py / read_searches_log.py --since-days 1 โ the day's searches |
| Sundays, 03:00 | rotate_searches.sh โ rotate the search log |
Adjust the frequencies to your forum's posting and upload volume.
<forum root>/
โโโ Sources/
โ โโโ QueryFrontend.php โ new: search-query logging
โ โโโ Search.php โ patched: ISE cases in the dropdown handler
โ โโโ ManageSettings.php โ patched: source toggles + the two reset checkboxes
โโโ Themes/default/
โ โโโ index.template.php โ patched: dropdown entries, loads widget_write_log.js
โ โโโ scripts/widget_write_log.js โ new: logs searches from the Google widget
โ โโโ languages/Modifications.english.php โ patched (language/ spelling patched too)
โโโ The_ISE_Project/ โ the search engine itself (web access blocked by .htaccess)
โ โโโ qf_*_bridge.php web entry points, one per source
โ โโโ search.py, PDFsearch.py, MiscSearch.py, MegaSearch.py, MediaSearch.py
โ โโโ IndexBuilder.py, PDFIndexer.py, MiscIndexer.py
โ โโโ MediaIndexer.py, MediaProcessor.py, AudioProcessor.py, MediaTranscriber.py
โ โโโ SearchCommon.py, SortEngine.py, RankingEngine.py, ResultFormatter.py, ise_render.py โฆ
โ โโโ ise_noindex.py the #do-not-index rule (must sit beside the indexers)
โ โโโ ISE_help.html the /help page
โ โโโ ISE_Manual.md the full manual
โโโ ISE_Data/ โ generated indexes, stores and logs (own .htaccess)
โ โโโ word_index*.json, *_store.json one pair per source, plus media/caption/audio/transcript stores
โ โโโ hf_cache/ AI model cache
โ โโโ tools/ small store-inspection helpers
โโโ pdfjs/ โ Mozilla PDF.js 6.2.108 viewer
ISE_Data/ is a full, searchable copy of every post and attachment on the forum, which is why it has its own .htaccess.
A normal reinstall or upgrade merges into ISE_Data/ and pdfjs/: existing indexes, logs and viewer files stay put.
For a genuinely clean slate, tick one or both boxes under Admin โบ Configuration โบ Modification Settings โบ CustomSearch before reinstalling:
| Checkbox | Deletes and recreates | Afterwards |
|---|---|---|
| Wipe pdfjs on next reinstall | pdfjs/, including any hand-made ln links inside it |
Re-create your links |
| Wipe ISE_Data on next reinstall | ISE_Data/ โ everything: every index and store, the model cache, duplicate/orphan state and all logs |
Rebuild every index, push audio_store.json again, re-transcribe every video. This takes a long time |
โ ๏ธ Each checkbox is one-shot: it fires on the next install, then clears itself so it can't wipe anything on a later reinstall you didn't mean as a reset. Both are unticked by default.
Uninstalling reverses the file patches and removes The_ISE_Project/. ISE_Data/ and pdfjs/ are deliberately left alone, because they hold real data that shouldn't vanish just because the mod was removed.
#do-not-indexWrite #do-not-index in a post and ISE leaves that post, and every attachment on it, out of every index. All three conditions must hold:
Remove the tag and the post comes back on the next index run. If the list of marked posts can't be read from the database, every indexer stops and writes nothing; none of them treats a failed lookup as "nothing to exclude".
Not yet covered: captions and CLIP vectors already made for an image or video that is marked later stay in their stores until
MediaProcessor.pygets the same clean-up.
Every real search is logged: the native SMF box, all five ISE sources and the site's Google widget, with username (or Guest), IP address, time and the exact query.
LOCAL0: tag smf-queries for searches made on the site; ise-search-ssh, ise-pdf-search-ssh and ise-misc-search-ssh (with a leading [SSH]) for searches run directly on the server. Usually lands in /var/log/messages./var/log/searches: a dedicated log of SMF searches (owner root:apache, mode 660).| Tool | Shows |
|---|---|
daily_queries.py |
Today's searches |
query_log_reader.py [--since-days N] |
Search history from syslog |
read_searches_log.py [--since-days N] |
Search history from /var/log/searches |
backfill_searches.py |
One-off (safe to re-run): copies old smf-queries lines, rotated logs included, into /var/log/searches |
๐ Privacy: once enabled, every user's search terms are logged, guests included (by IP address). On a harm-reduction forum those searches can be sensitive. Decide who can read your syslog and how long to keep this history before switching it on for everyone.
| Folder | Mod | Version | Why |
|---|---|---|---|
| Required SMF Mods | Board-color-and-icons | 1.1 | Board colours on result cards |
| Automatic Package Version Emulation | 1.6 | Lets CustomSearch install on SMF 2.0.x | |
| CustomSearch | 1.0 | Supplies the search-engine dropdown ISE plugs into | |
| Suggested SMF Mods | Collaborative | 6.5 | The shared Collabware/ library โ needed for ISEmedia |
| Integration Hooks Report | 1.5.3 | Lists the integration hooks your mods have registered | |
| Who Downloaded Attachment | 1.1.18 | Shows who downloaded each attachment | |
| Add [nobbc] button | 1.1 | A [nobbc] button for the post editor |
|
| Uninst&Del | 2.5 | Uninstall and delete a package from Package Manager in one step | |
| Recommended ISE Mods | ISE_BoardFocus | 1.0.0 | Makes the Search Focus Dropdown's "This board" choice work with all five ISE sources, with a banner saying so. Edits no SMF or ISE file (two integration hooks only). Needs the Search Focus Dropdown mod |
| Symptom | Likely cause |
|---|---|
| Same results whatever the query | The bridge PHP failed silently and served a stale results file |
| Almost nothing found on a busy forum | The index wasn't rebuilt after content changed |
| ISE options missing from the dropdown | The index.template.php patch didn't match. Compare whitespace with cat -A |
| Package Manager says "Skipping Search" | The text being searched for isn't in your file. Pull the file and diff it |
| Patch shows installed but the page hasn't changed | PHP OPcache or SMF's cache: restart Apache, then clear SMF's cache under Admin โบ Maintenance |
| ISEmega or ISEmedia stops at 180 results | Not a bug: the soft cap. Click Show all |
No module named 'numpy' / 'torch' from a media script |
Wrong interpreter. Use python3.8 |
AudioProcessor says FATAL: this host is โฆ |
It only runs on the media-processing machine by default. Add --any-host |
#do-not-index ignored |
Tag below line 5, or the author isn't a moderator or above |
The full table is in ISE_Manual.md ยง11.
| File | For |
|---|---|
The_ISE_Project/ISE_Manual.md |
The complete manual: operator guide, every script's options and history, tools, dependencies |
The_ISE_Project/ISE_help.html |
The in-app "How search works" page for forum users (/help) |
Changelog.md |
Release-by-release changes |
readme.txt |
The Package Manager readme (BBCode) |
ISE_BoardFocus/ISE_BoardFocus_Manual.md |
Inside the BoardFocus zip |
Where the manual and a script disagree, the script is right.
| Version | Milestone |
|---|---|
| 1.0 | Search over SSH |
| 2.0 | Web results page and full Python tracing |
| 3.0 | Relevance ranking |
| 4.1 | Packaged as a portable SMF mod |
| 5.0 | ISEpdf |
| 6.0 โ 6.1 | ISEmisc; 13 themes |
| 7.x | Text viewer, real ranking for PDF and text, duplicate PDF spotter, wildcards, PDF.js caching |
| 8.x | ISEmega; shell themes; 32-bit and 64-bit PDF indexers |
| 9.0 โ 9.5 | ISEmedia for images and video; dedicated search log; /sort |
| 9.6 โ 9.8 | Audio tagging, tempo/key search, speech-to-text, search test battery |
| 9.9 | AND by default; /sort use-OR |
| 10.0 โ 10.1 | Shared matching code (SearchCommon.py), Python 3.8 support, name hits ranked first |
| 10.2 โ 10.4 | #do-not-index, .avif support, video transcription on the forum server |
| 10.5 | Collaborative 6.5 bundled, ISE_BoardFocus add-on, manuals consolidated into one |
Details in Changelog.md.
ISE โ ยฉ 2026 Andrew Egerszegi, a "Collabware" effort with Claude.ai, ChatGPT and Gemini. Released under the MIT licence.
PDF.js โ ยฉ Mozilla, under the Apache License 2.0 (pdfjs/LICENSE).
The mods in Required SMF Mods/ and Suggested SMF Mods/ belong to their own authors and carry their own licences.