Content Filtering

Filter Arguments

Graphlit supports a wide variety of filtering options, when querying contents (including when publishing or summarizing contents).

You can add one or more optional filter arguments to narrow the set of contents which will be returned from the query.

  --search                 Search by text.
  
  --search-type            Similarity search type.

  --content-types          Filter by content types (comma-delimited).

  --file-types             Filter by file types (comma-delimited).

  --file-size-range        Filter by file size range (from,to).

  --date-range             Filter by original date range (from,to).

  --duration               Filter by duration (i.e. PT5M, PT1D).

  --location               Filter by location [lat,lon].

  --distance               Filter by distance (km).

  --item-type              Filter by item type.

  --items                  Filter by item identifier(s).

Search Examples

g query --type content --search "{text}" --search Vector
g query --type content --search "{text}" --search Hybrid
g query --type content --search "{text}" --search Keyword

Filter Examples

Content Types

You can filter by one or more content types.

g query --type content --content-types Page,File

File Types

You can filter by one or more file types.

g query --type content --file-types Document,Audio,Video

Feeds

You can filter by one or more feeds, by feed identifiers (comma-delimited).

g query --type content --item-type Feed --items "{guid},...,{guid}"

Collections

You can filter by one or more collections, by collection identifiers (comma-delimited).

g query --type content --item-type Collection --items "{guid},...,{guid}"

Observable

You can filter by one or more observable entities (i.e. Person, Organization, Place), which uses the Graphlit knowledge graph relationships to only return content where the entity was observed.

For example, we can filter by content which are linked to a specific person. (i.e. by the sender of email).

If you have enabled entity extraction in the content workflow, those extracted entities are automatically filterable via this same approach.

g query --type content --content-types Email --item-type Person --items "{guid}"

Note, you must provide the identifier of the person, not its name or email. If you need to lookup a person by name or email, you can query first to get the identifier.

g query --type person --email "from@company.com" --fields "{ id }"
g query --type person --name "First Last" --fields "{ id }"

Original Date Range

You can filter on the original date of the content, either from a specific date to today, or between a start and end date.

The 'original date' is the date that content was authored, i.e. the date a picture was taken).

Dates must be formatted in ISO-8601 format (yyyy-MM-dd'T'HH:mm:ss.SSSZ).

g query --type content --date-range "2022-01-01T00:00:00Z"
g query --type content --date-range "2017-06-03T00:00:00Z,2017-06-15T00:00:00Z"

File Size Range

You can filter by the file size of the content, either greater than a file size, or between a lower and higher file size.

g query --type content --file-size-range "10000000"
g query --type content --file-size-range "2000000,10000000"

Geo-location

You can filter by the geo-location of the content, if the latitude and longitude exist in the content metadata. (The geo-location is automatically indexed from image and video metadata.)

The location filter is the latitude and longitude, comma-delimited. The distance filter is in kilometers.

g query --type content --location "41.881832,-87.623177" --distance 10

Last updated