mirror of
https://github.com/standardebooks/web.git
synced 2025-07-21 14:55:13 -04:00
Add a Relevance
sort order and improve search
Here's what's in `IndexableText` right now: 1. Title 2. Collections 3. Authors 4. Tags 5. LocSubjects 6. TocEntries Here is the proposed new ranking: ``` 10 * Title + 8 * Authors + 3 * Collections + IndexableText ``` New indices for existing DBs: ``` ALTER TABLE `Ebooks` ADD COLUMN `IndexableAuthors` text NOT NULL; ALTER TABLE `Ebooks` ADD COLUMN `IndexableCollections` text NULL; ALTER TABLE `Ebooks` ADD FULLTEXT `indexSearchTitle` (`Title`); ALTER TABLE `Ebooks` ADD FULLTEXT `idxSearchAuthors` (`IndexableAuthors`); ALTER TABLE `Ebooks` ADD FULLTEXT `idxSearchCollections` (`IndexableCollections`); ```
This commit is contained in:
parent
b2df8a7018
commit
1a71913794
8 changed files with 120 additions and 15 deletions
|
@ -25,8 +25,13 @@ CREATE TABLE IF NOT EXISTS `Ebooks` (
|
|||
`EbookUpdated` datetime NULL,
|
||||
`TextSinglePageByteCount` bigint unsigned NULL,
|
||||
`IndexableText` text NOT NULL,
|
||||
`IndexableAuthors` text NOT NULL,
|
||||
`IndexableCollections` text NULL,
|
||||
PRIMARY KEY (`EbookId`),
|
||||
UNIQUE KEY `index1` (`Identifier`),
|
||||
KEY `index2` (`EbookCreated`),
|
||||
FULLTEXT `idxSearch` (`IndexableText`)
|
||||
FULLTEXT `idxSearch` (`IndexableText`),
|
||||
FULLTEXT `idxSearchTitle` (`Title`),
|
||||
FULLTEXT `idxSearchAuthors` (`IndexableAuthors`),
|
||||
FULLTEXT `idxSearchCollections` (`IndexableCollections`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue