I am trying to understand how LDA can be used for text-retrieval, and I am currently using the gensim's LdaModel model for implementing LDA, here: https://radimrehurek.com/gensim/models/ldamodel.html.
I have managed to identify the k topics and their most-used words, and I understand that LDA is about probabilistic distributions of topics and how words are distributed within those topics in the documents, so that much makes sense.
That said, I do not understand how to use the LdaModel to retrieve the documents that are relevant to a string input of search query eg "negative effects of birth control". I have tried inferring topic distributions on the search query and finding similarities between the topic distribution on the search query and the topic distributions from the corpus using gensim's similarities.MatrixSimilarity to compute cosine similarity like so:
lda = LdaModel(corpus, num_topics=10)
index = similarities.MatrixSimilarity(lda[corpus])
query = lda[query_bow]
sims = index[query]
But the performance isn't really good. What I figure is that finding the topic distribution of the search query is not too meaningful because there is usually only 1 topic in the search query. But I don't know how else I could implement this on the LdaModel on gensim. Any advice would be really appreciated, I am new to topic modeling and maybe I am missing something that's glaringly obvious to me? Thanks!