Creating a 'middleware' of sorts with Wappler

Hey all,

So on our ElasticSearch project, we have our main interface that returns results from our API > ES query.

Our current implementation (non Wappler) has a middleware that loops through all results returned on the page, and then displays additional user based data onto the record itself.

Crude example, we could display based on this - whether or not a user has viewed that record before, live right on the search results from the ElasticSearch API.

This is all custom work - that I’m trying to replicate with standard Wappler UI and functionality.

Conceptually I’m thinking using the repeat on the API record ID’s might work, then querying the DB that holds the user + record information.

Two things I’m struggling with on that.

  1. Looping through (I have one initial test up) caused performance issues with the results initially displaying on the page, when compared to without.
  2. Getting the user data onto the specific records card that is in the dynamic repeat group.

Perhaps one option could be to somehow get the API results > Repeat > Query then the output of all of that somehow into an array in a a Set Value and I use the Set Value as the source for what’s displayed on the page in the repeat group and cards.

I’m not sure how I’ll combine all the data necessary into the Set Value yet, but thought I’d open this to more advanced minds on the forum to see what the most performant focused option would be to achieve the above?

Noting we have 100’s of millions of records, 29+ filters so performance is always top of mind.

Appreciate any / all input on this.

Community Page
Last updated: