cb8ce486ca5a9e68e54f9b87072a728827fdd224 kent Fri Oct 26 21:34:53 2012 -0700 Improving documentation of text search interface. diff --git src/inc/trix.h src/inc/trix.h index 7bb3a56..ec60a91 100644 --- src/inc/trix.h +++ src/inc/trix.h @@ -1,17 +1,18 @@ /* trix - text retrieval index. Stuff for fast two level index - * of text for fast word searches. */ + * of text for fast word searches. Generally you use the ixIxx program + * to make the indexes. */ struct trix /* A two level index */ { struct lineFile *lf; /* Open file on first level index. */ struct trixIxx *ixx; /* Second level index in memory. */ int ixxSize; /* Size of second level index. */ int ixxAlloc; /* Space allocated for index. */ struct hash *wordHitHash; /* Hash of word hitsLists, so search on "the the the" works fast. */ }; struct trixSearchResult /* Result of a trix search. */ { struct trixSearchResult *next; @@ -22,24 +23,25 @@ int leftoverLetters; /* Number of leftover letters in words. */ }; #define trixPrefixSize 5 /* Size of prefix in second level index. */ struct trix *trixOpen(char *ixFile); /* Open up index. Load second level index in memory. */ void trixClose(struct trix **pTrix); /* Close up index and free up associated resources. */ struct trixSearchResult *trixSearch(struct trix *trix, int wordCount, char **words, boolean expand); /* Return a list of items that match all words. This will be sorted so that * multiple-word matches where the words are closer to each other and in the - * right order will be first. Do a trixSearchResultFreeList when done. - * If expand is TRUE then this will match not only the input words, but also - * additional words that start with the input words. */ + * right order will be first. Single word matches will be prioritized so that those + * closer to the start of the search text will appear before those later. + * Do a trixSearchResultFreeList when done. If expand is TRUE then this will match not + * only the input words, but also additional words that start with the input words. */ void trixSearchResultFree(struct trixSearchResult **pTsr); /* Free up data associated with trixSearchResult. */ void trixSearchResultFreeList(struct trixSearchResult **pList); /* Free up a list of trixSearchResults. */