The problem of finding the most relevant documents as a result of an extended and refined query is considered. To solve it, a search model and a text preprocessing mechanism are proposed. It is proposed to use a search engine and a model based on an index using word2vec algorithms to generate an extended query with synonyms. To refine the search results, the idea of selecting similar documents in the digital semantic library is used. The paper investigates the construction of a vector representation of documents in relation to the data array of the digital semantic library LibMeta. Each piece of text is labeled. Both the whole document and its separate parts can be marked. Search through the library content, search for new terms and new semantic relationships between terms of the subject area becomes more meaningful and accurate. The task of enriching user queries with synonyms was solved. When building a search model in conjunction with word2vec algorithms, a "indexing first, then learning" approach is used, which allows obtaining more accurate search results. This work can be considered one of the first stages in the formation of a training data array for the subject area of problems of mathematical physics and the formation of a dictionary of synonyms for this subject area. The model was trained on the basis of the library's mathematical content. Examples of training, extended query and search quality assessment using training and synonyms are given.