Wap-Lastic Extension (Elastic Search for Node JS)

Having had to create our own form of 'Elastic Search' for various Projects we decided to be done with it and create our own extension. You all know the difficulties with creating great search and how important it is to an application so hopefully you'll appreciate the effort that went in to this. And NO it was not all pumped out by A.I we had previously created dozens of incredibly complex Server Actions to do exactly this, and these were used as training input for our string of LLMs (we use several LLM's in parallel to ask questions among themselves) to formulate the best possible output. They'll keep arguing back and fourth until they agree and then we'll proceed to build the 'thing', just to give you some insight in to our methodology, if you were interested...

Wap-Lastic - Elastic Search for Node JS Projects!

Platform: Wappler Server Connect (Node)

In one line: elastic-style, relevance-ranked search for Wappler (tokenised terms, weighted columns, boost fields), without running Elasticsearch or hand-writing huge SQL actions.


The problem

Wappler makes it straightforward to query a database, but high-quality search (multiple words, different importance per column, boost fields, exclusions, sorting by relevance, pagination) quickly becomes a maintenance burden. Teams often end up with:

  • One huge Server Connect action full of raw SQL

  • Duplicated logic when a column is added or renamed

  • Poor matches when users type partial or reordered phrases (fishing london vs Fishing shop london)

  • Fragile front-end bindings tied to copy-pasted action structure


What Wap-Lastic does

Wap-Lastic is a reusable Server Connect extension that sits after your normal database query:

  1. You keep using Wappler’s query builder for connection, tables, joins, and filters.

  2. Wap-Lastic receives that result set, tokenises the user’s search terms, scores each row using weights you define in the UI, applies optional boost columns, sorts, and paginates.

  3. Each row gets relevance_score and boosted_score for debugging or display.

You configure search in grids and data pickers, not by cloning a project-specific SQL monster.


Who it’s for

  • Wappler developers building catalogues, directories, listings, or admin search

  • Teams that want relevance ranking without maintaining 500+ line actions

  • Projects that need flexible $_GET bindings (any parameter name for terms, limit, offset)

  • Anyone migrating from hand-rolled weighted SQL to something editable in the IDE


How it’s useful day to day

| Benefit | Detail |

|---------|--------|

| Faster iteration | Add or reweight a column in a grid, not in nested SQL |

| Clearer APIs | Optional output column list; array response matches query-step bindings |

| Separation of concerns | SQL for ā€œwhat rows are candidatesā€; Wap-Lastic for ā€œhow to rank themā€ |

| Portable | No hardcoded connection names, tables, or column names in the module |

| Two modes | In-memory scoring on query results (default), or generated MySQL SQL for scale |


Some visuals to help comprehend the issue...

Avoid this:

Instead have this:

2 Likes

Can grab it here:

Feedback welcome and if you find it useful you can Buy Me a Coffee which gives me the incentive to continue to offer things like this for FREE!

1 Like

ā€˜MrCheeseGit’ har har har…..

On a serious note though, thats a serious amount of extension you created there - looks like it does some heavyweight lifting. I’ve got a complex personnel search app (which was a right ball ache to make and manage) which would be suited to this - I’ll get it installed over the weekend and give it a blast - I’ll report back any findings…

1 Like

Hahahaha... Yeah man I am a real git! Well spotted!!

:joy:

It is quite a complex extension but then the task in-hand was very complex. This literally replaces all that with a few select options. The result is a very powerful search function.

Scenario:
You have a company paying to rank higher in results on a job site. You can add a column to your database called weight or score or rank etc. Give that a value. Highest value will come first in results. Then you can add weights to existing columns and prioritise which is more important with regards to the search results. It is also a fuzzy search so even if the values don't exactly match they'll still get results, and on top of that it can search across columns, as an example, for location, province, category, sub category, give them all weights and will return results based on a combination the User enters and the weights you specified so you can be very specific in controlling the search.

For your site it would be very well suited indeed Tom!

Edit:
In other sectors this would be a commercialised product on its own. In a few hours it has been cloned 14 times but only you have shared interest. Would be nice if others who have cloned it share their feedback though. You know that feeling that sometimes you think to yourself......

2 Likes