Stuck on how to make a complex search using check boxes

The site I’m making is supposed to let people search for texts in specific categories, such as genre, country of origin, and year of publication. Most of the texts will be entered through the back end.

The way users search is through a series of check boxes. A user will tick the categories that are relevant to them (e.g. Books from Europe, Asia, etc, Genres such as Horror, Historical, etc). They then click on the search button and the page they’re brought to will list the most relevant books depending on what they’ve ticked.

There are two main data types: “Text Categories” and “Serch Categories”. Each text categoty has columns equivalent to the search category.

The basics of how I want the search system to work is, is that the “Yes/no” of each column in the “Text Categories” will be compared with the equivalent column in the “Serch Categories”. For the number of columns which match points will be awarded, which will then be totalled up and used to rank the results.

The issues I’m having is that I’m not sure how to intergrate the sorting system into the site. Would I need to use a JavaScript plugin? If so how could I get it to pull and compare all of the rows and columns in the app data one after the other?

I know this is a bit of a complicated question, but I’d really appreciate and help available.

You might find some info that gets you started in this post: