How much weight to give search words appearing in _____

So I wrote my first search engine giving a post 1 point if a word appears anywhere at least once. If second search word is entered, and it appears at least once on the post, then the post gets another point. So if four search words entered, all the posts with all four words appears at the top.

It works good but, to separate the wheat from the chaff, a weighting system could be used depending on where the word occurs and how often.

I’m thinking:

  • 10.0 points for each time a word appears in the post’s Title.
  • 5.0 points for each time a word appears in Tags.
  • <h1> then 2 .0 points, <h2> is 1.5 points, <h3> is 1.0 points, <h4> is 0.75 points.
  • Anywhere else in body (including code blocks) then 0.5 points for each time a word appears.

Does this word weighting scheme sound reasonable?

Is there something I missed?



NOTE: 425 words occurring about 100,000 times are totally ignored. Like “how”, “who”, “what”, “where”, “when”, “why”, “I”, “can”, “a”, “the”, “etc”, etc. This saves bandwidth fetching the file from GitHub to client web browser. I read somewhere GitHub Pages has quota of 100 GB network egress per month.