Superls.MergedIndex (superls v1.2.3)
View Sourceiex> mi = Superls.Store.get_merged_index_from_store("test", "" = _passwd)
`[{"/media/vol1",
%{
"ACTION" => %{
"filename1 ACTION" => %{
size: 0,
atime: 1_742_806_274,
mtime: 1_742_806_274
},
"filename2 ACTION" => %{
size: 0,
atime: 1_742_806_274,
mtime: 1_742_806_274
}
},
"filename1" => %{
"filename1 ACTION" => %{
size: 0,
atime: 1_742_806_274,
mtime: 1_742_806_274
}
},
"filename2" => %{
"filename2 ACTION" => %{
size: 0,
atime: 1_742_806_274,
mtime: 1_742_806_274
}
}
}},
{"/media/vol2 ⭐️",
%{
"JAZZ" => %{
"filename3 JAZZ" => %{
size: 0,
atime: 1_742_806_274,
mtime: 1_742_806_274
}
},
"filename3" => %{
"filename3 JAZZ" => %{
size: 0,
atime: 1_742_806_274,
mtime: 1_742_806_274
}
}
}}]`
This sample shows a merged index from 2 volumes, /media/vol1
and /media/vol2 ⭐️
.
Each index holds a map of tags.
Last, each tag references all files that contain the tag.
This merged index is stored encrypted or not on the local filesystem.
Summary
Functions
Returns a list of files referenced by the merged index tags by volume.
Returns a volume-flattened files list.
Count the tags
return the metrics as a map restricted to limit_tags_count
most used tags.
Returns a list of files sorted by the oldness cmd
from the date date
and limited in size by ndays
.
Returns a list of files sorted by the oldness cmd
from the date date
and limited in size by ndays
.
Returns a map containing best jaro
distances as a numerical key and their associated matching files.
Returns a list of files sorted by the oldness cmd
and limited in size by nentries
.
Returns a sorted list of files with similar size
.
Return a map of {tag
=> count
}.
Types
Functions
Returns a list of files referenced by the merged index tags by volume.
@spec flatten_files_vol(files_vol :: [{volume(), %{required(file_name()) => map()}}]) :: [ {file_name(), map()} ]
Returns a volume-flattened files list.
Count the tags
@spec metrics(t(), limit_tags_count :: integer()) :: %{ num_tags: integer(), num_files: integer(), files: [file_name()], num_tags: integer(), tags: [tag()], most_frequent: String.t() }
return the metrics as a map restricted to limit_tags_count
most used tags.
@spec search_bydate(t(), cmd :: String.t(), date :: Date.t(), ndays :: integer()) :: [ {file_name(), map()} ]
Returns a list of files sorted by the oldness cmd
from the date date
and limited in size by ndays
.
iex> mi |> MergedIndex.search_bydate("xo", "10.03.31", 50)
[..]
Returns a list of files sorted by the oldness cmd
from the date date
and limited in size by ndays
.
iex> mi |> MergedIndex.search_bydate("xo", "10.03.31", 50)
[..]
@spec search_duplicated_tags(t()) :: %{ required(jaro :: float()) => [{file1 :: tuple(), file2 :: tuple()}] }
Returns a map containing best jaro
distances as a numerical key and their associated matching files.
@spec search_oldness(t(), cmd :: String.t(), nentries :: integer()) :: [ {file_name(), file_attr_tags :: map(), volume()} ]
Returns a list of files sorted by the oldness cmd
and limited in size by nentries
.
iex> mi |> MergedIndex.search_oldness("xo", 50)
[..]
Returns a sorted list of files with similar size
.
Return a map of {tag
=> count
}.