SearchQueryString

SearchQueryString["query"]

represents a search engine-style query in TextSearch and related functions.

Details

  • The following can be used within the query:
  • term1 term2 terms that must all occur
    "term1 term2 "a string of terms that must occur literally
    +terma term that must occur
    -terma term that must not occur
    term~a term that should occur at least approximately
    "term1 term2 "~na string of terms that must occur at most n words apart
    field:forma form that should occur within a given field
    form^ba form that is to be boosted by b for purposes of ranking
  • The following additional and alternate forms are also supported:
  • term1 AND term2 AND terms that must all occur
    term2 OR term2 OR terms where at least one must occur
    NOT terma term that must not occur
    (query)grouping within a query string
    \ca character such as + or : that must occur verbatim

Examples

open allclose all

Basic Examples  (6)

Match an exact phrase:

A sequence of terms is interpreted as ContainsAll by default:

Search in a particular field:

Require "dog" but disallow "Alice":

A Boolean query where the weight of "lorem" is reduced:

Hyphenated words in queries match only the documents where the words appear both contiguously and in the same order:

Possible Issues  (2)

Wildcard searches interact with stemming, so "ali?" matches but "alic?" does not:

SearchQueryString can only be used when searching on an index:

Wolfram Research (2016), SearchQueryString, Wolfram Language function, https://reference.wolfram.com/language/ref/SearchQueryString.html.

Text

Wolfram Research (2016), SearchQueryString, Wolfram Language function, https://reference.wolfram.com/language/ref/SearchQueryString.html.

CMS

Wolfram Language. 2016. "SearchQueryString." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SearchQueryString.html.

APA

Wolfram Language. (2016). SearchQueryString. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SearchQueryString.html

BibTeX

@misc{reference.wolfram_2024_searchquerystring, author="Wolfram Research", title="{SearchQueryString}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/SearchQueryString.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_searchquerystring, organization={Wolfram Research}, title={SearchQueryString}, year={2016}, url={https://reference.wolfram.com/language/ref/SearchQueryString.html}, note=[Accessed: 22-November-2024 ]}