DTSRINDEX(1)
π NAME π
This is dtsrindex from the (user cmd) manual, bestie β and sheβs here to load the inverted index for document objects. Thatβs the whole ~vibe~: sheβs the second half of the DtSearch loading duo, and sheβs lowkey iconic. π
β¨
β¨ SYNOPSIS β¨
dtsrindex-ddbname [-tetxstr] [-h0 | -hhashsz ] [-rrecdot s] [-bbatchsz] [-ccachesz] [-iinbufsz] file
π¦ DESCRIPTION π¦
Okay so picture this: dtsrindex is the second of a pair of programs that load a database with documents data from an input fzk file. The other one is dtsrload, which loads document header information and optionally the documents themselves. dtsrindex parses words from document text and loads them into the inverted index files. Word parsing is performed in the specified language and linguistic codeset of the database, and the inverted index contains the search terms used for subsequent online queries. Searchable tea: indexed and served. π«Ά
An fzk file can be generated by dtsrhan manually with a text editor, or by a special application program created for the purpose. Typically the same fzk file is used for dtsrload and dtsrindex. However, it is not required, and there are situations where it may not be desirable. If the same fzk file is not used by both programs, the one used for dtsrindex must represent the same objects in the same order. Only the unique key line and the text portions of the file are used by this program. (See dtsrfzkfiles(4) for information about DtSearch fzk files.) No cap, order matters. π
A documentβs unique key in the fzk file must already preexist in the database β that is, dtsrload must be executed before dtsrindex. If any words are already indexed for the unique document key, indicating dtsrload βupdatedβ the document, then the newly parsed words from the current fzk file will totally replace the previously indexed words. Out with the old word soup, in with the new. π
When duplicate record ids are encountered in a single fzk file, only the first occurrence of the document is indexed into the database; the second one is discarded. Since this is exactly the same discard order as dtsrload, the same fzk file can be used for both programs. Duplicate record ids are maintained during execution with a hash table. First one wins, bestie. π
dtsrindex performs two passes. In the first pass, dtsrindex constructs an inverted index in memory of all the words it parses from the fzk file. Since the index is built in memory, it is possible to run out of memory for very large fzk files. For this reason very large fzk files are processed in batches. Execution time in the first pass depends on the size of the fzk file. Pass 1 is giving βmake it make sense in RAM.β π§ β¨
In the second pass, dtsrindex merges the information in the memory index into the databaseβs disk inverted index. Execution time in the second pass depends on both the size of the incoming fzk file and the overall size of the database. Pass 2 is the disk-merge main character era. πΎπ«
If dtsrindex is interrupted in the first pass, it can be reexecuted without database damage. However if it is interrupted in the second pass, the database will be corrupted. Database backups are always recommended. FR FR: backups are not a drill. ππ¨
Caution: To prevent database corruption, executedtsrindexonly after all users of a preexisting database have exited their search programs. For a singlefzkfile,dtsrloadmust be executed immediately beforedtsrindexso thatdtsrindexcan map the words it indexes to the correct internal database addresses. Only after both programs successfully complete execution may users again be allowed to perform online searches of the database. Like, literally do not skip this part. π
πΈ OPTIONS πΈ
The following options are available:
Note: If an option takes a value, the value must be directly appended to the option name without white space. No lil gap, no spacebar moment β stick it right on there. π
-ddbnameβ Specifies the 1 to 8 ASCII character name of the database to be updated. If an optional directory path is not prepended to the database name,dtsrindexwill attempt to open the database from the current working directory. File name extensions for database files are automatically appended. Short name, big job. π-tetxstrβ Specifies the end of document text delimiter string. The default document separator in anfzkfile is an ASCII form feed character followed by an ASCII line feed ('). For certain multibyte languages it may be more convenient to specify a nonASCII string as the document delimiter. Custom delimiter? We love a flexible boundary. π¦-h0β Instructsdtsrindexto not check for duplicate record ids. This option should not be specified unless it is certain that there are no duplicate ids in thefzkfile. Only use this if you are absolutely sure, bestie β no guessing. π¨-hhashszβ Sets the duplicate record id hash table size tohashsz. The default is3000.dtsrindexwill execute more efficiently if the specified table size is larger than the number of documents in thefzkfile. Bigger table, comfier duplicate-checking vibes. π΅-rrecdotsβ Instructsdtsrindexto print a progress character to stdout for everyrecdotsdocuments processed during the first pass. The default is20. Little dots go brrr, progress stays visible. β¨-bbatchszβ Sets the batch size tobatchsz. The default is10000. The batch size is the maximum number of records processed in Pass 1 before copying the in memory index to disk in Pass 2. Larger batch sizes significantly improve execution time in Pass 2, but require exponentially larger amounts of memory. The default batch size has been optimized for moderately fast machines with large amounts of memory. Speed vs. RAM: the eternal group-chat debate. π₯-ccacheszβ Sets the number of 1024 byte cache pages used by the DtSearch Database Management System tocachesz. The default is64. The cache size affects memory paging performance for word b-trees.cacheszshould be greater than or equal to16, in even powers of 2. The default is usually sufficient. Word b-trees said βcache me outside.β π-iinbufszβ Sets the size of the input line buffer toinbufsz. The default is1024bytes. This buffer is used only for reading the four ASCII header lines for each document in anfzkfile. (The text portion of each document is parsed on the fly a word at a time.) Increasinginbufszmay be appropriate for very large abstracts, but the default is sufficient in most cases. Huge abstract energy? Maybe bump it. Otherwise chill. π
π OPERANDS π
The required input file name (file) identifies the file to be processed by dtsrindex. It can optionally include a path prefix, either from root or relative to the current working directory. If a file name extension is not specified, dtsrindex assumes a default extension of .fzk. So batch1 can absolutely mean batch1.fzk β sheβll fill in the blank. π
π¦ ENVIRONMENT VARIABLES π¦
None. Literally none. Empty. No env-var drama. π
π RESOURCES π
None. Nothing to see here, bestie. β¨
π ACTIONS/MESSAGES π
None. No actions, no messages β just vibes and indexing. π«Ά
π RETURN VALUES π
The return values are as follows:
0βdtsrindexcompleted successfully. Slay. It ate and left no crumbs. π1βdtsrindexsuccessfully recovered from an error. This occurs when one or more documents were discarded because of a partially invalidfzkfile format, duplicate record ids, or empty record text. Messy but recoverable β she pulled through. πβ¨>1βdtsrindexencountered a fatal error. Big yikes. Fatal error means stop and go fix the situation. π
πΈ FILES πΈ
dtsrindex reads the specified fzk file and opens all the database and related language files for the specified database name.
dtsrindex updates the following database files:
dbname.d21
dbname.d22
dbname.d23
dbname.k21
dbname.k22
dbname.k23
dbname.d99
These are the database files getting the glow-up, no cap. πΎπ
β¨ EXAMPLES β¨
Index all words in the fzk file named batch1.fzk in the current working directory into database mydb.
dtsrindex -dmydb batch1
Load database mydb with the documents specified in the fzk file /u/dtsearch/jpndocs.1. Three ASCII plus signs at the bottom of each document signals the end of document text and the beginning of the next fzk file record.
dtsrindex -dmydb -t+++ /u/dtsearch/jpndocs.1
Custom delimiter example ate, honestly. ππ₯
π«Ά SEE ALSO π«Ά
dtsrload(1), dtsrhan(1), dtsrfzkfiles(4), DtSearch(5)
And thatβs the whole vibe, bestie! There was literally no source/version/date footer in the original page β just dtsrindex(user cmd) β so hereβs your cute sign-off: dtsrindex(user cmd) ππβ¨
π¦ where this page comes from
- nixos 26.05: cde 2.5.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms