For now, most search engines have limitations on finding the most suitable results from documents at a semantic level. This paper aims to provide users with more accurate document search results not only at a syntactic level but also on a semantic level. For example, when a user searches 'coffee' on Amazon, does the user only want coffee? Coffee is a kind of functional drink, the user may also want to know other functional drinks such as tea or Redbull. Coffee helps people stay awake, the user may just want something to help him/her stay awake or focused. In this project, document data from a question-and-answer website called Stack Exchange is analyzed and compared by using the Latent Dirichlet Allocation (LDA) and Latent Semantic Analysis (LSA) topic modeling algorithm. After completing topic modeling, using an ontology built with Protégé, data is further processed at a semantic level. We utilize the ontology rules and instances to optimize the search results.