Finding files and text

When DataMind Oda needs a file on your computer, or a piece of text inside one, it searches for it. A file search matches files by their name; a content search matches text inside files. This page covers what each search accepts and how precise it can be. For reading a single file, see Read, write and edit files; for the chat side of a search, see Searching your files.

The two searches

Both searches run in the folder Oda works in for the chat. Name another folder in your request and the search runs there instead; a relative name is read from the folder Oda works in.

Searching by file name

Oda matches each file's name against a pattern, so a search can be as wide or as narrow as you need:

Searching inside files

Oda works through the files below the folder to find a piece of text:

What searches include and skip

How much a search can return

A search answers with one bounded result, so its size stays predictable:

The saved file is named glob-results.txt for a file search and grep-results.txt for a content search; where these files live and when they are cleared up is covered in Large results and spill files.

Questions, answered

Where does Oda search when I do not name a folder?

In the chat's workspace, the folder Oda works in for that chat (Workspaces, files and permissions). Name another folder in your request and the search runs there instead; a relative name is read from the workspace.

Does a search look in subfolders as well?

Yes. A pattern with no folder separator matches a file's name at any depth, so the search reaches every folder below the one it runs in. To keep a search in one folder, name that folder or include it in the pattern.

Does a search include hidden files?

Yes. A file whose name begins with a dot, or that an ignore list would normally hide, is searched like any other file; only the version-control folders stay out.

Why can't Oda search inside .git?

Folders like .git hold a version-control tool's own data, not your work, so no search enters them: .git, .svn, .hg, .bzr, .jj and .sl are excluded even when a search points straight at one of them. Files next to them are searched as usual.

Can I search only certain kinds of files?

Yes. Ask for the kind of file you mean, and Oda adds one name filter to the search, for example *.ts for one kind or *.{js,jsx} for two kinds in a single pattern. A filter must be one positive pattern; one that starts with !, or that lists patterns separated by commas, is refused.

How many results can one search return?

A file search keeps up to 100 paths in its result, and a content search up to 250 matches; a matched line longer than 2,000 characters is cut and marked. Anything beyond that is in the complete result Oda saves and names in the note on the result.

Why did a search stop before it finished?

A search is stopped if it runs for more than about 30 seconds, or if it produces more output than one result can carry (about 20 MB). Ask again with a narrower pattern, folder or filter and Oda runs a smaller search.

What does (line is not valid UTF-8) mean?

That match sits in a line that is not plain text, so Oda cannot show the line and writes this note in its place. The match is still reported, under its file and line number.

Does a search keep running after it gives me its result?

No. A search runs inside its step and returns there; nothing keeps working afterwards. There is no second page either: what did not fit is in the saved complete result.