{"id":306,"date":"1997-09-09T01:36:29","date_gmt":"1997-09-09T09:36:29","guid":{"rendered":"http:\/\/www.birdhouse.org\/betips\/?p=306"},"modified":"1997-09-09T01:36:29","modified_gmt":"1997-09-09T09:36:29","slug":"manipulating-filesystem-indexes","status":"publish","type":"post","link":"https:\/\/www.betips.net\/?p=306","title":{"rendered":"Manipulating filesystem indexes"},"content":{"rendered":"<p>In order to run a system query, at least one of the attributes of the filetype being searched on must be indexed by the system. BeOS does not index every attribute of every filetype because that would result in an impact on performance. You can see which attributes are currently being indexed by opening a Terminal and typing<\/p>\n<pre>lsindex<\/pre>\n<p>If you want more details on the lsindex output, use<\/p>\n<pre>lsindex -l<\/pre>\n<p>If you want to search on an attribute that isn&#8217;t currently being indexed, you can create a new index by typing<\/p>\n<pre>mkindex [attribute_name]<\/pre>\n<p>For example, let&#8217;s say you&#8217;ve associated an attribute with an internal name of <code>META:Author<\/code> with your text\/plain filetype, and you want to be able to search your system for text files authored by a certain person. Type:<\/p>\n<pre>mkindex META:Author<\/pre>\n<p>From now on, all new text files that you create will have their <code>META:Author<\/code> attribute added to the <code>META:Author<\/code> index. <!-- THIS SECTION IS NEW --><br \/>\nThe datatype of a new index is &#8222;string&#8220; by default. If the attribute involves numbers and you want to do numerical searches on those numbers, you&#8217;ll need to make sure you create an index of type &#8222;int&#8220;. For example, if you&#8217;re creating a &#8222;year&#8220; attribute and corresponding index, and you want to search on files with a year index between 1973 and 1977, use something like:<\/p>\n<pre>mkindex -t int TEXT:Year<\/pre>\n<p>There are, however, two things to note:<br \/>\n<!-- END NEW SECTION --> 1) New indexes are not retroactive &#8212; if you have a ton of text files with Author attributes, they won&#8217;t be automatically added to the new index. To have old files added, just use the Tracker to copy (not move) them to a new location. The act of copying them will add their attributes to the new index.<br \/>\n2) A newly created attribute will not become immediately visible in the Find panel unless you give it a friendly name (a description) in the FileTypes panel, and <a href=\"\/chunga.php?ID=329\">restart the Tracker<\/a> (or reboot).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In order to run a system query, at least one of the attributes of the filetype being searched on must be indexed by the system. BeOS does not index every attribute of every filetype because that would result in an impact on performance. You can see which attributes are currently being indexed by opening a [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[13],"class_list":["post-306","post","type-post","status-publish","format-standard","hentry","tag-tracker"],"_links":{"self":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=306"}],"version-history":[{"count":0,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/306\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}