Choose what is indexed
Every host has a scope: a short document that says which items are indexed and how deeply. The defaults are good for a personal folder. Change them when a folder is large, old, or full of files you never search.
The depths
Section titled “The depths”| depth | the index keeps | you can |
|---|---|---|
exclude |
nothing | nothing: the item does not exist for inseam |
catalog |
the address, size, dates, type and title | find it by name, read it |
embed |
all of that and the text | find it by what it says |
The default for a folder is: everything from the last year at embed, everything older at catalog, and the
usual noise at exclude.
The document
Section titled “The document”{ "window": { "by": "mtime", "within": "1y", "outside": "catalog" }, "rules": [ { "when": { "path": { "glob": "**/node_modules/**" } }, "then": "exclude" }, { "when": { "size": { "gt": 26214400 } }, "then": "catalog" }, { "then": "embed" } ], "limits": { "maxObjectBytes": 268435456, "maxTextBytes": 2097152 }}- window: items changed within the duration get the depth the rules give them. Items outside the window get
at most
outside. Durations are6m,1y,2w,30d,12h;mis 30 days andyis 365. - rules: in order, first match wins. A rule’s
whenconditions are all required. The last rule has nowhenand sets the default. - limits: items over
maxObjectBytesare never read; text overmaxTextBytesis cut.
Conditions
Section titled “Conditions”| on | you can write |
|---|---|
path |
{"glob": "**/*.pdf"}, {"prefix": "Archive/"}, {"eq": "notes.md"}, {"in": ["a.md", "b.md"]} |
ext |
the same four, on the lowercased extension without the dot: {"in": ["log", "tmp"]} |
mime |
the same four, on the type: {"prefix": "image/"} |
size |
{"gt": 26214400}, {"lte": 1024} (bytes; gt, gte, lt, lte) |
mtime |
{"within": "90d"}, {"before": "2024-01-01T00:00:00Z"}, {"after": "…"} |
Globs: * matches anything except /, ** matches across folders, ? one character, {a,b} either. A pattern
without a / matches the file name only, so *.log matches a log anywhere. A pattern with a / matches the
whole path within the host.
Examples
Section titled “Examples”Index a photo library by name only, and skip the sidecar files:
{ "rules": [ { "when": { "ext": { "in": ["xmp", "aae"] } }, "then": "exclude" }, { "then": "catalog" } ] }Index a project’s documents fully and nothing else:
{ "rules": [ { "when": { "path": { "glob": "docs/**" } }, "then": "embed" }, { "then": "exclude" } ] }Index everything from the last 90 days, keep the rest by name:
{ "window": { "by": "mtime", "within": "90d", "outside": "catalog" }, "rules": [ { "then": "embed" } ] }Change a scope
Section titled “Change a scope”In the app, open the host and choose Scope. Or with the API:
curl -X PUT https://app.inseam.io/v1/hosts/h1a2b3c4d5e6/scope \ -H "Authorization: Bearer ias_…" -H "Content-Type: application/json" \ -d '{"rules": [{"then": "embed"}]}'A new scope applies to new and changed items at once. Items already indexed deeper than the new scope allows are reduced on the host’s next walk; items that the new scope indexes deeper are re-read then. The exact grammar is in the scope reference.