📄 glimpseindex.1
字号:
The default value is 80%.(If there are less than 256 files, then the stop-list is not maintained.)The medium index (-b) counts all occurrences of all words, and a wordis added to the stop-list if it appears at least k times per MByte.The default value is 500.A query that includes a stop list word is of course less efficient.(See also LIMITATIONS below.).TP.B \-t (A new option in version 3.5.)The order in which files are indexed is determined by scanningthe directories, which is mostly arbitrary.With the \-t option, combined with either \-o and \-b, the indexed files are stored in reversed order of modification age (younger files first).Results of queries are then automatically returned in this order.Furthermore, glimpse can filter results by age; for example, askingto look at only files that are at most 5 days old..TP.B \-Tbuilds the turbo file. Starting at version 3.0, this is the default,so using this option has no effect..TP.B \-w kGlimpseindex does a reasonable, but not a perfect, job of determiningwhich files should not be indexed.Sometimes a large text file should not be indexed; forexample, a dictionary may match most queries.The -w option stores in a file called .glimpse_messages (in the samedirectory as the index) the list of all files that contributeat least \fIk\fP new words to the index. The user can look at this listof files and decide which should or should not be indexed.The file .glimpse_exclude contains files that will not be indexed(see more below). We recommend to set \fIk\fP to about 1000.This is not an exact measure. For example, if the same file appearstwice, then the second copy will not contribute any new wordsto the dictionary (but if you exclude the first copy and index again,the second copy will contribute)..TP.B \-X(starting at version 4.0B1) Extract titles from HTML pages and addthe titles to the index (in .glimpse_filenames).(This feature was added to improve the performance of WebGlimpse.)Works only on files whose names end with .html, .htm, .shtml, and .shtm. (see glimpse.h/EXTRACT_INFO_SUFFIX to add to these suffixes.)The routine to extract titles is called extract_info, in index/filetype.c. This feature can be modified in various ways to extract info from many filetypes.The titles are appended to the corresponding filenames with a spaceseparator.Glimpseindex assumes that filenames don't have spaces in them..TP.B \-zAllow customizable filtering, using the file .glimpse_filters to perform the programs listed there for each match. The best example iscompress/decompress. If .glimpse_filters include the line.br*.Z uncompress <.br(separated by tabs)then before indexing any file that matches the pattern "*.Z" (samesyntax as the one for .glimpse_exclude) the command listed isexecuted first (assuming input is from stdin, which is why uncompressneeds <) and its output (assuming it goes to stdout) is indexed.The file itself is not changed (i.e., it stays compressed).Then if glimpse -z is used, the same program is used on these fileson the fly. Any program can be used (we run 'exec'). For example,one can filter out parts of files that should not be indexed.Glimpseindex tries to apply all filters in .glimpse_filters in theorder they are given.For example, if you want to uncompress a file and then extractsome part of it, put the compression command (the example above)first and then another line that specifies the extraction.Note that this can slow down the search because the filters need tobe run before files are searched..SH "GLIMPSEINDEX FILES".LPAll files used by glimpse are located at the directory(ies) where the index(es) is (are) stored and have .glimpse_ as a prefix.The first two files (.glimpse_exclude and .glimpse_include) areoptionally supplied by the user. The other files are built andread by glimpse..LP.IP "\fB.glimpse_exclude\fR"contains a list of files that glimpseindex is explicitly told to ignore. In general, the syntax of .glimpse_exclude/include is the same asthat of agrep (or any other grep). The lines in the .glimpse_excludefile are matched to the file names, and if they match, the files are excluded. Notice that agrep matches to parts of the string!e.g., agrep /ftp/pub will match /home/ftp/pub and /ftp/pub/whatever.So, if you want to exclude /ftp/pub/core, you just listit, as is, in the .glimpse_exclude file.If you put "/home/ftp/pub/cdrom" in .glimpse_exclude, every filename that matches that string will be excluded, meaning all filesbelow it.You can use ^ to indicate the beginning of a file name, and $ toindicate the end of one, and you can use * and ? in the usual way.For example /ftp/*html will exclude /ftp/pub/foo.html, but willalso exclude /home/ftp/pub/html/whatever; if you want to excludefiles that start with /ftp and end with html use ^/ftp*html$Notice that putting a * at the beginning or at the end is redundant(in fact, in this case glimpseindex will remove the * when it does the indexing).No other meta characters are allowed in .glimpse_exclude(e.g., don't use .* or # or |).Lines with * or ? must have no more than 30 characters.Notice that, although the index itself will not be indexed,the list of file names (.glimpse_filenames) will be indexedunless it is explicitly listed in .glimpse_exclude..IP "\fB.glimpse_filters\fR"See the description above for the -z option..IP "\fB.glimpse_include\fR"contains a list of files that glimpseindexis explicitly told to \fIinclude\fP in the index even though they may looklike non-text files. Symbolic links are followed by glimpseindex only if they are specifically included here.The syntax is the same as the one for .glimpse_exclude (see there).If a file is in both .glimpse_exclude and .glimpse_include it will beexcluded unless -i is used..IP "\fB.glimpse_filenames\fP"contains the list of all indexed file names, one per line.This is an ASCII file that can also be used with agrep to searchfor a file name leading to a fast find command.For example, .brglimpse 'count#\\.c$' ~/.glimpse_filenames.brwill output the names of all (indexed) .c files that have 'count' intheir name (including anywhere on the path from the index).Setting the following alias in the .login file may be useful:.bralias findfile 'glimpse -h \!:1 ~/.glimpse_filenames'.IP ".\fBglimpse_index\fP"contains the index. The index consists of lines, each starting with aword followed by a list of block numbers (unless the -o or -b options are used, in which case each word is followed by an offset into the file .glimpse_partitions where all pointers are kept).The block/file numbers are stored in binary form, so this is not an ASCII file..IP "\fB.glimpse_messages\fP"contains the output of the -w option (see above)..IP "\fB.glimpse_partitions\fP"contains the partition of the indexed space into blocksand, when the index is built with the -o or -b options, some part of theindex. This file is used internally by glimpse and it isa non-ASCII file..IP "\fB.glimpse_statistics\fP"contains some statistics about the makeup of the index. Useful forsome advanced applications and customization of glimpse..SH "STRUCTURED QUERIES"Glimpse can search for Boolean combinations of "attribute=value" termsby using the Harvest SOIF parser library (in glimpse/libtemplate). To search this way, the index must be made by using the -s option ofglimpseindex (this can be used in conjunction with other glimpseindexoptions). For glimpse and glimpseindex to recognize "structured" files,they must be in SOIF format. In this format, each value is prefixed byan attribute-name with the size of the value (in bytes) present in "{}"after the name of the attribute. For example, The following lines are part of an SOIF file:.br.nftype{17}: Directory-Listingmd5{32}: 3858c73d68616df0ed58a44d306b12ba.fiAny string can serve as an attribute name.Glimpse "pattern;type=Directory-Listing" will search for "pattern"only in files whose type is "Directory-Listing".The file itself is considered to beone "object" and its name/url appears as the first attribute with an"@" prefix; e.g.,@FILE { http://xxx... }The scope of Boolean operations changes from records(lines) to whole files when structured queries are used in glimpse(since individual query terms can look at different attributes and theymay not be "covered" by the record/line). Note that glimpse can onlysearch for patterns in the value parts of the SOIF file: there are some attributes (like the TTL, MD5, etc.) that are interpreted by Harvest'sinternal routines.See http://harvest.cs.colorado.edu/harvest/user-manual/ for more detailedinformation of the SOIF format..SH "REFERENCES".IP 1.U. Manber and S. Wu,"GLIMPSE: A Tool to Search Through Entire File Systems,"\fIUsenix Winter 1994 Technical Conference\fP(best paper award),San Francisco (January 1994), pp. 23\-32.Also, Technical Report #TR 93-34, Dept. of Computer Science,University of Arizona, October 1993 (a postscript fileis available by anonymous ftp atftp://ftp.cs.arizona.edu/reports/1993/TR93-34.ps)..IP 2.S. Wu and U. Manber,"Fast Text Searching Allowing Errors,"\fICommunications of the ACM\fP\fB35\fP (October 1992), pp. 83\-91..SH "SEE ALSO".BR agrep (1),.BR ed (1),.BR ex (1),.BR glimpse (1),.BR glimpseserver (1),.BR grep (1V),.BR sh (1),.BR csh (1)..SH LIMITATIONS.LPThe index of glimpse is word based. A pattern that contains more thanone word cannot be found in the index. The way glimpse overcomes thisweakness is by splitting any multi-word pattern into its set of wordsand looking for all of them in the index.For example, \fBglimpse 'linear programming'\fR will first consult the indexto find all files containing both \fIlinear\fP and \fIprogramming\fP,and then apply agrep to find the combined pattern.This is usually an effective solution, but it can be slow forcases where both words are very common, but their combination is not..LPThe index of glimpse stores all patterns in lower case.When glimpse searches the index it first convertsall patterns to lower case, finds the appropriate files,and then searches the actual files using the originalpatterns.So, for example, \fIglimpse ABCXYZ\fR will first find allfiles containing abcxyz in any combination of lower and uppercases, and then searches these files directly, so only theright cases will be found.One problem with this approach is discovering misspellingsthat are caused by wrong cases.For example, \fIglimpse -B abcXYZ\fR will first search theindex for the best match to abcxyz (because the pattern isconverted to lower case); it will find that there are matcheswith no errors, and will go to those files to search themdirectly, this time with the original upper cases. If the closest match is, say AbcXYZ, glimpse may miss it,because it doesn't expect an error.Another problem is speed. If you search for "ATT", it will lookat the index for "att". Unless you use -w to match the whole word,glimpse may have to search all files containing, for example, "Seattle"which has "att" in it..LPThere is no size limit for simple patterns and simple patternswith Boolean AND or OR.More complicated patterns are currently limited to approximately 30 characters.Lines are limited to 1024 characters.Records are limited to 48K, and may be truncated if they are largerthan that.The limit of record length can be changed by modifying the parameter Max_record in agrep.h..LPEach line in .glimpse_exclude or .glimpse_include that contains a * or a ? must not exceed 30 characters length..LPGlimpseindex does not index words of size > 64..LPA medium-size index (-b) may lead to actually slower query timesif the files are all very small..LPUnder -b, it may be impossible to make the stop list empty.Glimpseindex is using the "sort" routine, and all occurrencesof a word appear at some point on one line.Sort is limiting the size of lines it can handle (the value dependson the platform; ours is 16KB).If the lines are too big, the word is added to the stop list..SH BUGS.LPPlease send bug reports or comments to glimpse@cs.arizona.edu..SH DIAGNOSTICS(Only in version 3.6 and above.).brexit status 0: terminated normally;.brexit status 1: glimpseindex errors (e.g., bad option combos, no files wereindexed, etc.).brexit status 2: system errors (e.g., write failed, sort failed, malloc failed)..SH AUTHORSUdi Manber and Burra Gopal, Department of Computer Science, University of Arizona, and Sun Wu, the National Chung-Cheng University,Taiwan. (Email: glimpse@cs.arizona.edu)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -