Linking terms to categories for improved search results

Hi,

We are trying to improve the search results of our documents by using one field with categories on top of the text search we are using for some fields.
As example if you search for the word pen, you probably should get more results from the stationery category, which is in stored in a field.
Or if you search for the term laptop, more results from the IT category should come. And not from lets say the stationery, or storage.
We are using a wordnet synonyms file in the index and was wondering if something like this could be done via a dictionary like wordnet by adding our own synonyms.
Or if we would need to program it in the layer before ES and pass the query already fully formed with the categories field in it, boosting its weight for the search.

Thanks,
Isaac