SearchResultObject

SearchResultObject[]

represents a result from TextSearch[] and related functions.

Details

  • The following operations can be used on SearchResultObject[]:
  • Normal[obj]give all results in a list
    Dataset[obj]give all results in a dataset
    obj[1;;n]give the first n results in a list
    obj[1;;n,"Snippet"]give the snippets associated with the first n results
    obj[n]give the n^(th) result
    obj[n,"Snippet"]give the snippet associated with the n^(th) result
    obj[spec,prop]give the specified property of the results selected by spec
    obj["Count"]give a count of the total number of results
  • Each result is given in the form of a ContentObject[] expression.

Examples

Basic Examples  (1)

Search for files involving "dog":

Extract all content objects out of the SearchResultObject:

Get the top two search results:

Get the top search result:

Get the number of search results:

Extract a given field of a selected result:

Extract a given field of all results:

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

Text

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

BibTeX

@misc{reference.wolfram_2021_searchresultobject, author="Wolfram Research", title="{SearchResultObject}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/SearchResultObject.html}", note=[Accessed: 21-September-2021 ]}

BibLaTeX

@online{reference.wolfram_2021_searchresultobject, organization={Wolfram Research}, title={SearchResultObject}, year={2016}, url={https://reference.wolfram.com/language/ref/SearchResultObject.html}, note=[Accessed: 21-September-2021 ]}

CMS

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

APA

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