This Search Solutions 2024 presentation introduces the bag-of-documents model as a way to align query and document representations — specifically addressing the gap between the broad variability of query intents and the inherent specificity of individual documents or products. It describes how to compute bag-of-documents representations of frequent queries by aggregating document vectors from their clicks and then using those query vectors as training data to build a sentence transformer model for infrequent queries. It then shows how the bag-of-documents model is useful to recognize query similarity and compute query specificity, both of which are helpful for improving quality, experience, and analytics for search applications.