SearchAdjustment[query,w]
represents a component of a search query that is to be treated as having weight w.
SearchAdjustment[query,…,opts]
represents a component of a search query with certain options.
SearchAdjustment
SearchAdjustment[query,w]
represents a component of a search query that is to be treated as having weight w.
SearchAdjustment[query,…,opts]
represents a component of a search query with certain options.
Details and Options
- Query components without SearchAdjustment[…] are effectively treated as having weight 1.
- In SearchAdjustment[query,w], larger weights w make this component be considered more important for purposes of ranking search results.
- Possible options for SearchAdjustment include:
-
MaxWordGap 0 maximum gap in words allowed between tokens
Examples
open all close allBasic Examples (1)
index = CreateSearchIndex["ExampleData/Text"];Give more weight to documents containing the word "dog":
TextSearch[index, SearchAdjustment["dog", 20] | "lorem"][All]Without the extra weight, a different ranking is given:
TextSearch[index, "dog" | "lorem"][All]Scope (2)
Queries can have multiple adjusted components:
TextSearch[CreateSearchIndex["ExampleData/Text"], SearchAdjustment["dog", 7] | SearchAdjustment["lorem", 1.5]][All]If the given weight is less than 1, the adjusted component is given less importance:
TextSearch[CreateSearchIndex["ExampleData/Text"], SearchAdjustment["dog", 3] | SearchAdjustment["lorem", 0.5]][All]See Also
Related Guides
History
Text
Wolfram Research (2016), SearchAdjustment, Wolfram Language function, https://reference.wolfram.com/language/ref/SearchAdjustment.html.
CMS
Wolfram Language. 2016. "SearchAdjustment." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SearchAdjustment.html.
APA
Wolfram Language. (2016). SearchAdjustment. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SearchAdjustment.html
BibTeX
@misc{reference.wolfram_2026_searchadjustment, author="Wolfram Research", title="{SearchAdjustment}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/SearchAdjustment.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_searchadjustment, organization={Wolfram Research}, title={SearchAdjustment}, year={2016}, url={https://reference.wolfram.com/language/ref/SearchAdjustment.html}, note=[Accessed: 12-June-2026]}