tflookup – Developer Diary Part 3
Dear Diary!
Now that I have a documentation index, I could write a server, that serves that index and searches it. That server will ultimately also deliver my frontend application, because I’m too lazy to do it the microservices way right now.
The most easy and stable web server for Node I know today is ExpressJS and that’s what I used.
I’m mostly doing my projects in Typescript today, so that was my basic setup.
After the index has been created or read from my pre-rendered index, the server starts up, registers its endpoints and listens for requests.
One very simple controller would basically just output various areas of the index:
- the complete index
- All available vendors
- The available object types (datasources and resources) for a vendor
- All datasources by the vendor and all resources by the vendor
The interesting part came with the search endpoint.
I could simply return all items that include a certain query, but I wanted weighted results.
See, I’m no search engine expert and other people can do that way better, but I tried.
How could I weigh the search results? I needed to make a decision workflow for that and weigh upon the results
- Datasources and resources are much more relevant than Vendors
- Resources are more relevant than datasources (yes, that one is highly opinionated)
- Matches in names are more relevant than in descriptions
- If a match is found in the vendor and an object, the result becomes more relevant
Additionally, I blatantly steal the string ranking algorithm of the wonderful Keeweb project
I guess, that’s as good as it gets currently.
Yours
Dennis
This post is one of five posts from the tflookup developer diary series
Cover Image: „diary writing“ by Fredrik Rubensson
Originally published to dev.to
Calendar
M | D | M | D | F | S | S |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Archive
- Januar 2024
- Dezember 2023
- April 2021
- März 2021
- September 2020
- Dezember 2019
- November 2019
- Oktober 2019
- Juli 2019
- Juni 2019
- Mai 2019
- April 2019
- März 2019
- September 2018
- August 2018
- Juli 2018
- März 2018
- Januar 2018
- Dezember 2017
- September 2017
- März 2017
- Februar 2017
- Januar 2017
- August 2016
- Mai 2016
- Dezember 2015
- November 2015
- August 2015
- März 2015
- Dezember 2014
- September 2014
- August 2014
- Juli 2014
- Februar 2014
- Oktober 2013
- September 2013
- August 2013
- Juli 2013
- Juni 2013
- Mai 2013
- April 2013
- November 2012
- Oktober 2012
- September 2012
- August 2012
- Juni 2012
- Mai 2012
- März 2012
- Februar 2012
- Januar 2012
- November 2011
- Juli 2011
- Juni 2011
- März 2011
- Februar 2011
- Januar 2011
- Dezember 2010
- November 2010
- April 2010
- Februar 2010