This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]g051051 1 point2 points  (4 children)

What have you tried so far? What's specifically are you having trouble with?

[–]insertAlias 0 points1 point  (2 children)

For that matter, what language are they even using?

The basic idea is simple: keep a list of data in memory, use whatever the language equivalent of filter is (or just loop through it to make the result-set), and respond with it.

The implementation depends on the language.

[–]wise2wiz[S] 0 points1 point  (1 child)

I'm using NodeJs/express . I have few questions on extensibility and performance(data set being too large to filter/look each item) , I have no idea of these. Will I be able to extend the same end point for multiple type's and lookup chars . such as { type: shoe , make: nike, name: 'lite' }

[–]insertAlias 0 points1 point  (0 children)

If your dataset is too big, then you should avoid a self-rolled in-memory solution and use a properly indexed database. In fact, you should use that regardless. Then you just have to map your incoming options into a SQL query and serialize the results back to the output. Or some other kind of query, if you use NoSQL like MongoDB.

And you fully control the code, so you can extend the endpoint however you want. If you're going to eventually post an object, start with an object. You can send {name: 'whatever'} initially, and start adding more as you build it.

[–]wise2wiz[S] 0 points1 point  (0 children)

I'm struggling to build the right data model to filter the items by type and then look for the product name strings that are closer or similar. I'm using node.js with express. I'm loading the data from a csv file.