Wiki: Search Portal/Utilities / File Location Listing



The search portal is a Flask application serving a simple HTML page along with the search API.

The portal supports two search modes:

In Image mode, the portal will serve locally stored thumbnails. Clicking a thumb opens a preview modal offering links to the original as well as any associated context (like which page it was embedded in).

By default, the portal limits the number of returned results to 300. However, if more results are desired, the link labelled capped can be clicked to disable the search cap


Stats

A statistics endpoint was added to the search portal in v0.2.5

Requests placed to /stats will result in a JSON response like the following:

{
  "storage": {
    "DOC_index_cnt": 34951,
    "IMAGE_index_cnt": 11535,
    "IMPLIED_index_cnt": 10,
    "TAGS_index_cnt": 967,
    "TOMB_cnt": 0,
    "files": {
      "index": {
        "mtime": 1705119037,
        "size": 3123272
      },
      "index.tomb": {},
      "tags": {
        "mtime": 1705119037,
        "size": 70411
      }
    },
    "index_last_load": 1705145824,
    "index_last_mod": 1705119037,
    "load_age_s": 516
  }
}

It's possible to collect this information and write it into InfluxDB by using Telegraf configuration like the following

[[inputs.http]]
  urls = ["https://[your domain]/stats"]
  tagexclude = ["host"]
  name_override = "file_location_indexes"
  data_format = "json"

This will result in line protocol like the following

file_location_indexes,url=https://[your domain]/stats storage_index_last_load=1705145824,storage_index_last_mod=1705119037,storage_IMPLIED_index_cnt=10,storage_files_tags_size=70411,storage_files_index_size=3123272,storage_TAGS_index_cnt=967,storage_load_age_s=812,storage_DOC_index_cnt=34951,storage_files_tags_mtime=1705119037,storage_IMAGE_index_cnt=11535,storage_TOMB_cnt=0,storage_files_index_mtime=1705119037 1705146636000000000