mirror of
https://github.com/standardebooks/web.git
synced 2025-07-14 18:42:00 -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
|
@ -44,6 +44,10 @@ const EBOOKS_MAX_STRING_LENGTH = 250;
|
|||
const EBOOKS_MAX_LONG_STRING_LENGTH = 500;
|
||||
const EBOOK_SINGLE_PAGE_SIZE_WARNING = 3 * 1024 * 1024; // 3145728 bytes.
|
||||
|
||||
const EBOOK_SEARCH_WEIGHT_TITLE = 10;
|
||||
const EBOOK_SEARCH_WEIGHT_AUTHORS = 8;
|
||||
const EBOOK_SEARCH_WEIGHT_COLLECTIONS = 3;
|
||||
|
||||
const ARTWORK_THUMBNAIL_HEIGHT = 350;
|
||||
const ARTWORK_THUMBNAIL_WIDTH = 350;
|
||||
const ARTWORK_PER_PAGE = 20;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue