Wolfram Language & System 10.4 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

TextSearch

TextSearch[source,form]
searches for files referenced by source that contain text matching form.

DetailsDetails

  • TextSearch supports the following search forms:
  • "string"literal string
    {s1,s2,}all must appear in the document
    s1|s2|at least one of the must appear
    Except[q]q cannot appear
  • TextSearch allows the following to be used as sources:
  • "file"individual file
    SearchIndexObject[]search index generated by CreateSearchIndex
    {obj1,obj2,}list of objects
  • TextSearch returns a list of content objects, represented by ContentObject.
  • Files with an extension typical of binary files as well as files that contain non-textual byte values will not be indexed or searched.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Search for files in the specified directory that contain the word "dog":

In[1]:=
Click for copyable input
Out[1]=

Search for files containing both words:

In[1]:=
Click for copyable input
Out[1]=

Search for files containing either word:

In[2]:=
Click for copyable input
Out[2]=

Queries can be combined:

In[3]:=
Click for copyable input
Out[3]=
Introduced in 2015
(10.2)