๐Ÿ“ README.mdv4.7.5 · 2026-12-05

๐Ÿ”Ž ISE โ€” Intelligent Search Engine

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.

Version SMF Python PDF.js Licence

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.


Contents


๐Ÿงญ What it does

ISE 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.


โœจ Highlights


๐Ÿ“ Search cheat sheet

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.


๐Ÿ“‹ Requirements

Forum

Server

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)

๐Ÿš€ Installation

  1. Install the three required mods, in the order above.
  2. Install Collaborative v6.5 if you want ISEmedia.
  3. Install the Python packages listed under Requirements.
  4. Install ISE_v10.5.zip through SMF's Package Manager. The installer:
    • checks the required mods are present, and stops cleanly by name if not;
    • patches the search dropdown, the admin settings and the language strings;
    • copies The_ISE_Project/, ISE_Data/ and pdfjs/ into the forum root with 777 permissions;
    • starts 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/;
    • fills ISE_Data/hf_cache (the CLIP model cache) if it's empty.
  5. Switch the sources on: go to Admin โ€บ Configuration โ€บ Modification Settings โ€บ CustomSearch and tick ISE, ISEpdf, ISEmisc, ISEmedia and ISEmega, then save. If an option doesn't appear in the dropdown, untick it, save, tick it again and save.
  6. Fix any PDF.js links. The viewer now lives at $boarddir/pdfjs. If you had ln links pointing at an older $themedir/pdfjs, re-point them.
  7. Let the indexing finish, then test a search with each of the five. ISEmedia runs under a different interpreter, so a working ISE search says nothing about ISEmedia.
  8. Add the cron jobs (next section).

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).


โฐ Keeping the indexes fresh (cron)

Two files in the package hold the suggested schedules:

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.


๐Ÿ“ฆ What gets installed

<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.


๐Ÿ”„ Reinstalling, resetting and uninstalling

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.


๐Ÿšซ Keeping a post out of search: #do-not-index

Write #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:

  1. The tag is in the post body (any letter case). The subject and attached files are never checked.
  2. It's on lines 1โ€“5 of the body. Put it on line 1.
  3. The post's author is an Administrator, a Global Moderator, or a moderator of that board. Anyone else's tag is ignored.

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.py gets the same clean-up.


๐Ÿ“œ Search logging and privacy

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.

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.


๐Ÿงฉ Bundled mods

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

๐Ÿ› ๏ธ Troubleshooting

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.


๐Ÿ“š Documentation

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 history

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.


๐Ÿ™ Credits and licence

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.