Show HN: I created a search engine to quickly find things in my source code (github.com)

1 points by mrmcsoftware ↗ HN
I like to reuse code I've already written. But with so many projects over the many years, it's sometimes hard to remember which project I did a given thing in or even what the parameters of a rarely used Win32 API function are. I needed something that could easily find what I needed without the slowness of a recursive grep (especially since my projects can span many different locations in the filesystems and even many different computers/OSes) or the increasing difficulty in getting what you want from search engines on the internet.

This search engine implements TF-IDF and BM25 algorithms. It has both C TUI programs and a web interface via a node.js server which accesses the daemons. It's written for Windows and Linux. The user can use whatever flow they want - one-shot query vs. daemon (client/server), commandline tools vs web interface, secure vs. non-secure, etc. This project also serves as (IMHO) a rather good example of all sorts of things such as socket programming, OpenSSL programming, node.js programming, JSON processing, etc.

4 comments

[ 0.20 ms ] story [ 15.5 ms ] thread
This is absolutely relevant to my interests and I will try it out in a few hours as it is early morning in Europe now.

So far I do not see any licensing terms, the source file headers only state the copyright notice. Do you have any plans about that?

> I came up with the idea while waking up from a nap and then was so blinded by how great this feature would be to have.

This has happened to me many times. In my case I forget how my program works fron all the approaches I have tried while writing it, then get excited to try a great idea which then does not work because it relies on some feature from one of the alternatives that I rejected for some other reason.

I will indeed waste a few hours trying the PDF indexing idea, there has to be some way to make it work. I have done some feeble attempts in this direction by myself before using the C library pdfio which would work also on Windows. I will probably crash again on that wall but if the code search works as described I will still use this program every day.

I usually don't put a license in my repos, sometimes because I never really know which one to put in, and other times because I don't really know what I would want to allow or disallow, etc. I put a license on my vec-mat-comp-quat repo but that was because it was essentially a library so by its nature, it would have to be used in other people's code. The license I chose required (IIRC) or perhaps requested, that the users let me know how they use my library, but to this day, no one has - so that's another reason I don't usually put a license (people will probably ignore it anyway).

In regards to your story of essentially the path not taken: in general when I create a version that either doesn't work or doesn't work as well as I wanted, I keep the file around (renamed usually). Sometimes, much later I figure out how to make it work or some part of it becomes the basis of another project. Unless I didn't spend much time on it, I don't like to waste effort. The PDF addition was kind of an example of that - I kept the file around, but then when I was prettifying things up to upload to github, I figured I would add the PDF code to my file and put it within #ifdef's in case someone would want it. And also, in case you haven't noticed, I provided many different versions of the search system - it's harder to maintain, but allows the user to pick the option they like the most. So, in your case, you never know if the paths not taken might someday be paths you will want to go down.

I'll check out pdfio, it looks interesting.

For my own selfish purposes I would like to have a license that allowed me to reuse parts of SearchEngineSuite as if it was a library, for instance Apache 2.0 which I used for my C preprocessor at https://sentido-labs.com/en/library/cedro/202106171400/

I am preparing a pull request adding the Apache license in case it is acceptable for you.

I guess I wouldn't have a problem with that.