Simple but effective Search Engine module!

Being my first ever public module, I’d like to ensure I am doing this all correct so excuse my brevity.

This module is nowhere near amazing and nearly as optimized as it can be, however it was a fun project I did and is somewhat useful in most of my projects.

You can retrieve the module here and place it anywhere.

Functions

module:Register() - This function sets up the search engine with all the necessary variables and constants it needs.

module:ListCreate() - This function sets up your UI based stuff, creating items (frames/textbuttons) for each of the instances within a storage folder.

module.SearchEngine() - The main function, returns results of a inputted text from your searchboxes.

Arguments

The module:Register() function requires four arguments, which are in detail below;

  • searchBox: TextButton - The primary searchbox within the search engine.
  • itemsStorage: any - Anything with children inside of it which can show up for results (i.e a tools folder in serverstorage)
  • scrollingFrame: ScrollingFrame - The main UI part which will store all of the results (i.e a catalog)
  • buttonTemplate: any - This is the template that the script will clone for each result it finds within the itemsStorage folder.
Setup
  1. Require your module using require()
  2. Run module:Register(arguments), passing through the correct arguments
  3. Run module:ListCreate to initialise the list of items.
  4. That’s it!

Please feel free to leave comments, reviews and suggestions below!

v1

1 Like

May you show some examples? I still don’t really know what this is for.

4 Likes

This video doesn’t use the engine as the engine idea comes from the source code of that project, however it shows a usecase for a search engine.

Other stuff may be a item catalog or a shop in-game.

In my opinion, this type of system should not be modularized. It should be built-in to the code that handles the object slots that you’re showing. It’s much more efficient and less code that way.

That doesn’t make any sense, at all

3 Likes