索引

属性查询是Haiku的主要特性。由于属性只能独立的用于显示文件的附加信息,而对于查询,则需要建立索引。索引把属性放置在一个查询表中,而这也将会使查询更加轻量化和快速。
索引是文件系统的一部分,而且它独立于特定的磁卷和分区。

终端中的索引命令

有几个命令可以用于管理索引:

 ~ ->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 
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 命令。

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

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.