RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Editor AI TestsEditor AI VisualizationEditor – Assembly Spline ToolAsset BrowserAsset DeduplicatorAsset Management ToolSFX Previewer (Audio Events List)Audio Ribbon EditorAutoSaveBarriers EditorBiome ToolBuilding EditorBulk RenameCamera BookmarksCamera TransformCamera Path EditorCEF HelperCo-Simulation Signal EditorCrawl Data EditorCreate Object ToolDataBlock EditorDecal EditorDecal Spline EditorDocumentation HelperDrag Race EditorDrift Data EditorDrive Path EditorDynamic Decals Tool (Vehicle Livery Creator)Engine Audio DebugExtensions DebugExtensions EditorFFI Pointer Leak TestFile DialogFlowgraph EditorForest EditorForest ViewEditor Gizmo HelperEditor Ground Model Debug HelperEditor Headless Editor TestEditor Icon OverviewEditor ImGui C DemoEditor InspectorEditor Layout ManagerEditor Level SettingsEditor Level ValidatorEditor LoggerEditor Log HelperEditor MainEditor Main MenuEditor Main ToolbarEditor Main UpdateMap Sensor EditorMaster Spline EditorMaterial EditorMeasures Inspector HeaderMesh Editor (Base)Mesh Road EditorMesh Spline EditorMission EditorMission PlaybookMission Start Position EditorMulti Spawn Manager (Vehicle Groups)Navigation Mesh EditorEditor News MessageObject Tool (Object Select Edit Mode)Object To Spline EditorParticle EditorPerformance Profiler / Camera RecorderPhysics ReloaderPrefab Instance EditorEditor PreferencesRace / Path EditorRally EditorRaycast Test Editor ToolRenderer Components Editor ToolRender Test Editor ToolResource Checker Editor ToolRiver EditorRoad Architect EditorRoad DecorationsRoad Editor (Decal Road)Road Network ExporterRoad River Cache HandlerRoad River GUIRoad Spline EditorRoad Template EditorRoad UtilitiesScene TreeScene ViewScreenshot Creator BootstrapScript AI EditorScript AI ManagerSensor Configuration EditorSensor DebuggerShape EditorShortcut LegendSidewalk Spline EditorSites EditorSlot Traffic EditorSuspension Audio DebugTech Server ManagerTerraform ToolTerrain And Road ImporterTerrain EditorTerrain Materials EditorText EditorTool ManagerTool ShortcutsTraffic DebugTraffic ManagerTraffic Signals EditorUndo History ViewerVehicle Bridge TestVehicle Detail ViewerVehicle Editor MainEditor - VisualizationEditor Viz HelperEditor Water Object HelperEditor Windows Manager
Editor Element HelperPlot Helper UtilitySearch UtilityTransform UtilityVehicle Filter UtilityVehicle Select UtilityZone Selector Utility

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionseditorutil

Search Utility

Fuzzy text search utility with scoring, frecency-based result ranking, and a searchable ImGui combo box widget.

Fuzzy text search utility with scoring, frecency-based result ranking, and a searchable ImGui combo box widget.


Class: C (returned by factory function)

MethodSignatureDescription
C:init()-Sets default scoring and tie-breaking functions; frecency weight = 0.5
C:setScoringFunction(fun)fun(element, match) → scoreOverrides the scoring function
C:setSameScoreResolvingFunction(fun)fun(a, b) → boolOverrides tie-breaking (default: alphabetical)
C:startSearch(matchString)matchString: stringBegins a new search pass
C:queryElement(elem, scoringFunction)elem: {name, ...}Scores and potentially adds element to results
C:finishSearch()-Sorts results by finalScore (score × frecency blend); returns results
C:setFrecencyData(data)data: {[fId] = timestamp}Sets frecency timestamps
C:getFrecencyData()-Returns current frecency data
C:updateFrecencyEntry(fId)fId: stringRecords a selection event; supports 10s undo window
C:getFrecencyScore(fId)-Returns decay score (half-life: 24h, exponent: 1.25)
C:beginSearchableSimpleCombo(im, label, preview, elements, flags)-Renders a searchable combo widget; returns selected id or nil

Static Functions

FunctionDescription
C.matchStringScore(name, match, ignoreEarly)Multi-match fuzzy scorer with early-match bonus (0–1)

Usage Example

local searchUtil = require('/lua/ge/extensions/editor/util/searchUtil')

-- Create a search instance
local search = searchUtil()

-- Simple searchable combo box in ImGui
local items = {"apple", "banana", "cherry", "date", "elderberry"}
local selected = search:beginSearchableSimpleCombo(
  ui_imgui, "##fruitSearch", currentSelection, items
)
if selected then
  currentSelection = selected
  search:updateFrecencyEntry(selected) -- boost recently-picked items
end

-- Manual search with custom scoring
search:startSearch("ban")
for _, item in ipairs(items) do
  search:queryElement({
    id = item,
    name = item,
    frecencyId = item,
  })
end
local results = search:finishSearch()
for _, r in ipairs(results) do
  log("I", "", r.name .. " score=" .. r.finalScore)
end

-- matchStringScore scores multi-occurrence substring matches
-- with bonus for matches appearing early in the string
local score = searchUtil.matchStringScore("banana", "ban")
-- score ≈ 0.75 (3/6 chars matched, early match bonus)

-- Frecency: recently and frequently used items rank higher
-- Half-life is 24 hours; items decay exponentially
search:setFrecencyData({apple = os.time() - 3600}) -- 1 hour ago
local s = search:getFrecencyScore("apple") -- ~0.97

See Also

  • Editor Element Helper - Related reference
  • Plot Helper Utility - Related reference
  • Transform Utility - Related reference
  • World Editor Guide - Guide

Plot Helper Utility

Interactive 2D graph/plot widget for ImGui - supports multi-series data, Catmull-Rom spline interpolation, auto-scaling, dragging, zooming, annotations, and tooltip hover.

Transform Utility

Reusable position/rotation/scale editor widget with axis gizmo integration, helper buttons (down-to-terrain, focus, move-to-camera, align-with-terrain), and shift+click quick placement.

On this page

Class: C (returned by factory function)Static FunctionsUsage ExampleSee Also