Зміст
Атрибути і Запити є ключовими функціями Haiku. Хоча атрибути корисні самі по собі, для відображення додаткової інформації про файл, для виконання пошукових запитів на них, файли потрібно проіндексувати. Індексування поміщає їх у таблицю пошуку, яка, в свою чергу, робить пошукові запити блискавично швидкими.
Індекс є частиною файлової системи і зберігається для кожного тому/розділу окремо.
Команди індексування у терміналі
Існує кілька команд для управління індексом:
- lsindex – Відображає проіндексовані атрибути поточного тому/розділу
Це атрибути, які індексуються за замовчуванням:
~ ->lsindex BEOS:APP_SIG MAIL:account MAIL:cc MAIL:chain MAIL:draft MAIL:flags MAIL:from MAIL:name MAIL:pending_chain MAIL:priority MAIL:reply MAIL:status MAIL:subject MAIL:thread MAIL:to MAIL:when META:address META:city META:company META:country META:email META:fax META:group META:hphone META:name META:nickname META:state META:url META:wphone META:zip _signature _status _trk/qrylastchange _trk/recentQuery be:deskbar_item_status last_modified name size
- mkindex – Додає атрибут до індексу тому/розділу.
Usage: mkindex [options] <attribute>
Creates a new index for the specified attribute.
-d, --volume=PATH a path on the volume to which the index will be added,
defaults to current volume.
-t, --type=TYPE the type of the attribute being indexed. One of "int",
"llong", "string", "float", or "double".
Defaults to "string".
--copy-from path to volume to copy the indexes from.
-v, --verbose print information about the index being created
Тільки нові файли з цим атрибутом автоматично потрапляють до індексу!
Існуючі файли потрібно додати вручну, зробивши копію файлу і видаливши після цього оригінал. Також Ви можете скористатися командою reindex.
- reindex – Вносить атрибути існуючих файлів до щойно створеного індексу тому/розділу.
Usage: reindex [-rvf] attr <list of filenames and/or directories>
-r enter directories recursively
-v verbose output
-f create/update all indices from the source volume,
"attr" is the path to the source volume
- rmindex – Видаляє атрибут з індексу тому/розділу.
Usage: rmindex [OPTION]... INDEX_NAME
Removes the index named INDEX_NAME from a disk volume. Once this has been
done, it will no longer be possible to use the query system to search for
files with the INDEX_NAME attribute.
-d, --volume=PATH a path on the volume from which the index will be
removed
-h, --help display this help and exit
-p, --pattern INDEX_NAME is a pattern
-v, --verbose print information about the index being removed
INDEX_NAME is the name of a file attribute.
If no volume is specified, the volume of the current directory is assumed.