Closed gotlougit closed 2 years ago
I've made some improvements, like making sure each word has same importance when calculating the score of each page, conforming to the style requirements, and adding a no results found message.
I am looking for more feedback on the search feature since I do want to improve it and also get it into the project.
This new commit only searches through cache, but may need some more handling of edge cases (like if someone forcibly deletes the cache directory). However such cases seem to be pretty few and far between, so I think it's fine.
This is with reference to issue #172, where I proposed adding a search function to search for a specific subcommand for a given program
For example, searching for how to delete a branch in git can be done using this feature, using the command
Keep in mind that the very first word you type is the most impactful when trying to decide the most relevant page, the second one less so and so on and so forth.
While the search algorithm I've devised seems to work fairly well, there are some further enhancements I am looking to implement as well:
Searching for the keywords only in the examples given and not the command/subcommand summary
Highlighting the keywords wherever they are found in the text or only printing the examples where the keywords have been found.
Any code cleanup operations that need to be performed
Improvements to the search algorithm