You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 11, 2022. It is now read-only.
The first step is to run cindex with a list of directories or files to include in the index:
cindex /usr/include $HOME/src
By default cindex adds to the existing index, if one exists, so the last command is equivalent to the pair of commands:
cindex /usr/include
cindex $HOME/src
With no arguments, cindex refreshes an existing index, so after running the previous commands,
cindex
will rescan /usr/include and $HOME/src and rewrite the index. Run cindex -help for more details.
The index file contains a list of paths (for reindexing, as described above), a list of indexed files, and then the same posting lists we saw at the beginning of this article, one for each trigram. In practice, this index tends to be around 20% of the size of the files being indexed. For example, indexing the Linux 3.1.3 kernel sources, a total of 420 MB, creates a 77 MB index. Of course, the index is organized so that only a small fraction needs to be read for any particular search.
Search
Once the index has been written, run csearch to search: