GMLiteSearch

August 6, 2026 · View on GitHub

Lightweight full-text search engine for GameMaker

A pure GML framework that brings enterprise-grade search capabilities to your GameMaker projects. No external DLLs or extensions.


Overview

GMLiteSearch is a complete search solution for GameMaker, designed for small to medium datasets (10k-50k+ documents) with real-time indexing and advanced search features.


Features at a Glance

  • BM25 & TF-IDF scoring – Industry-standard relevance algorithms
  • Fuzzy search – Handles typos and misspellings
  • Prefix search – Autocomplete suggestions
  • Hybrid search – Exact matching with prefix fallback
  • N-gram search – Character-level matching for severe typos
  • Multi-field filtering – Category, tags, platform, price, etc.
  • Aggregation counts – Show how many results per facet value
  • Range facets – Numeric and date ranges
  • AND/OR operators – Flexible filter logic
  • Real-world coordinates – Latitude/longitude with radius and box search
  • Game coordinates – 2D, 3D, and grid-optimized for open worlds
  • Geohash support – Efficient proximity indexing
  • Distance calculation – Haversine for real world, Euclidean for game space

Learning-to-Rank (LTR)

  • Three trainable ranking models – Linear regression, pairwise RankNet, and gradient-boosted LambdaMART, selectable and comparable side-by-side
  • 7 built-in features – BM25, term frequency, title match, freshness, popularity, etc.
  • Custom features – Register your own feature extractors, learned alongside the built-ins
  • Model persistence – Save/load trained models, including full LambdaMART tree ensembles

Query Understanding

  • Spell checking – Automatic correction of typos
  • Auto-complete – Real-time suggestions as user types
  • Related queries – Based on click behavior and term similarity
  • Popular queries – Track most searched terms

Snippet Generation

  • Context-aware excerpts – Shows relevant text around matches
  • Term highlighting – Customizable markers around matched terms
  • Multiple strategies – Best fragment, surrounding, or balanced
  • Candidate generation – Multiple snippet options for UI selection

Developer Tools

  • Score explanation – Understand why a document ranked where it did
  • Performance profiling – Measure query execution time
  • Index inspection – Health checks and statistics
  • Benchmark suite – Automated performance testing

Persistence

  • JSON export/import – Save and load entire search index
  • Model persistence – Save trained LTR models
  • Quick start/load – Minimal setup for saved indexes

Use Cases

RPG Games

  • Item database – Search weapons, armor, potions by name, type, stats
  • Quest log – Find quests by keywords, rewards, locations
  • NPC dialogue – Search through dialogue trees for keywords
  • Location search – Find NPCs, shops, dungeons near player position

Strategy Games

  • Unit library – Search units by name, class, abilities
  • Tech tree – Find technologies by name, prerequisites, era
  • Resource management – Filter buildings by type, cost, production

Adventure/Puzzle Games

  • Inventory search – Find items by name, description, use
  • Clue database – Search through collected clues
  • Journal entries – Find lore entries by keywords

Content Management

  • Mod support – Search through user-generated content
  • Localization – Multi-language string searching
  • Asset management – Find sprites, sounds, animations by tags

Why GMLiteSearch?

Traditional ApproachGMLiteSearch
Linear text search (O(n))Inverted index (O(log n))
No relevance scoringBM25/TF-IDF scoring
No filteringFaceted search with aggregations
No location supportGeospatial queries (real-world + game coords)
Fixed rankingTrainable ranking, linear, RankNet, or LambdaMART
No typo toleranceFuzzy and n-gram search
Manual snippet generationAutomatic context-aware snippets

Quick Comparison

FeatureGMLiteSearchds_map manual searchGML built-in
Full-text search
Relevance scoring
Faceted filters
Geospatial
Learning-to-Rank (linear / RankNet / LambdaMART)
Spell checking
Auto-complete
Fuzzy matching
Persistence
Pure GML

Memory Performance

Figures assume short, single-sentence documents with a handful of metadata tags, larger or more varied text will cost more per document.

StemmingN-gramsDocument Method500 docs1,000 docs5,000 docs10,000 docs25,000 docs50,000 docsBytes/doc
onoffWeighted Document100.1 MB202.8 MB1,012.2 MB1.98 GB4.95 GB9.90 GB~212,600
offoffWeighted Document4.6 MB9.0 MB44.8 MB89.6 MB222.3 MB448.2 MB~9,400
ononWeighted Document104.2 MB208.4 MB1.02 GB2.03 GB5.09 GB10.17 GB~218,500
onoffPlain Document58.8 MB117.6 MB587.9 MB1.15 GB2.87 GB5.74 GB~123,300
offonWeighted Document8.75 MB17.5 MB87.5 MB175.0 MB437.5 MB875.0 MB~18,400
offoffPlain Document1.97 MB3.9 MB19.7 MB39.4 MB98.5 MB197.0 MB~4,100
ononPlain Document61.1 MB122.2 MB610.8 MB1.19 GB2.98 GB5.96 GB~128,100
offonPlain Document4.24 MB8.5 MB42.4 MB84.8 MB212.0 MB424.0 MB~8,900
  • Cheapest overall – stemming off, n-grams off, Plain Document
  • Note – savings don't simply add up; stemming off + Plain Document together saves more than either alone would suggest

Documentation


References

Relevance scoring (BM25 & TF-IDF) Spärck Jones, K. (1972) "A statistical interpretation of term specificity and its application in retrieval", Journal of Documentation, 28(1), 11–21 Robertson, S. E. and Walker, S. (1994) "Some Simple Effective Approximations to the 2-Poisson Model for Probabilistic Weighted Retrieval", SIGIR '94, 232–241 Robertson, S. and Zaragoza, H. (2009) "The Probabilistic Relevance Framework: BM25 and Beyond", Foundations and Trends in Information Retrieval, 3(4), 333–389 Robertson, S., Zaragoza, H. and Taylor, M. (2004) "Simple BM25 Extension to Multiple Weighted Fields", CIKM '04

Stemming Porter, M. F. (1980) "An algorithm for suffix stripping", Program, 14(3), 130–137 "The English (Porter2) stemming algorithm", Snowball

Fuzzy matching & n-gram search Jaccard, P. (1912) "The Distribution of the Flora in the Alpine Zone", New Phytologist, 11(2), 37–50 Kondrak, G. (2005) "N-Gram Similarity and Distance", SPIRE 2005

Spell correction Levenshtein, V. I. (1965; English translation 1966) "Binary codes capable of correcting deletions, insertions and reversals", Soviet Physics Doklady, 10(8), 707–710 Wagner, R. A. and Fischer, M. J. (1974) "The String-to-String Correction Problem", Journal of the ACM, 21(1), 168–173

Faceted search Yee, K-P., Swearingen, K., Li, K. and Hearst, M. (2003) "Faceted Metadata for Image Search and Browsing", CHI '03

Date/time handling ISO 8601:2019 "Date and time, Representations for information interchange", ISO

Geospatial search Sinnott, R. W. (1984) "Virtues of the Haversine", Sky and Telescope, 68(2), 159 Morton, G. M. (1966) "A Computer Oriented Geodetic Data Base and a New Technique in File Sequencing", IBM Technical Report Niemeyer, G. (2008) "Geohash"

Learning-to-Rank, linear model Cauchy, A-L. (1847) "Méthode générale pour la résolution des systèmes d'équations simultanées", Comptes Rendus de l'Académie des Sciences, 25, 536–538 Liu, T-Y. (2009) "Learning to Rank for Information Retrieval", Foundations and Trends in Information Retrieval, 3(3), 225–331

Learning-to-Rank, RankNet Burges, C., Shaked, T., Renshaw, E., Lazier, A., Deeds, M., Hamilton, N. and Hullender, G. (2005) "Learning to Rank using Gradient Descent", ICML '05, 89–96

Learning-to-Rank, LambdaMART, gradient boosting, and NDCG Breiman, L., Friedman, J. H., Olshen, R. A. and Stone, C. J. (1984) "Classification and Regression Trees", Wadsworth Friedman, J. H. (2001) "Greedy Function Approximation: A Gradient Boosting Machine", The Annals of Statistics, 29(5), 1189–1232 Järvelin, K. and Kekäläinen, J. (2002) "Cumulated Gain-Based Evaluation of IR Techniques", ACM Transactions on Information Systems, 20(4), 422–446 Burges, C. J. C. (2010) "From RankNet to LambdaRank to LambdaMART: An Overview", Microsoft Research Technical Report MSR-TR-2010-82 Wu, Q., Burges, C. J. C., Svore, K. M. and Gao, J. (2010) "Adapting Boosting for Information Retrieval Measures", Information Retrieval, 13(3), 254–270