The `Validate()` method is correctly setting it to null, but then the
`UPDATE` SQL statement is triggering another call to
`GetIndexableText()`. Without this change, empty strings are being
written to the `IndexableText` column.
This allows the user to run a keyword search and then change the sort
order. `Default` is interpreted as `Relevance` if a query is present,
`Newest` if not.
Having it in the SELECT fields was causing warnings like this:
```
NOTICE: PHP message: PHP Deprecated: Creation of dynamic property Ebook::$RelevanceScore is deprecated in /standardebooks.org/web/lib/Traits/Accessor.php
```
The data in these fields are separate:
* `IndexableText`
* `Title`
* `IndexableAuthors`
* `IndexableCollections`
There are also on indices on each of these fields so that they can have
separate weight in the relevance scoring.
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`);
```
Searching by `UrlName`, now for both `Artwork` and `Artist`, is clearer.
Take care to remove the apostrophes outright, don't replace them with a
space because otherwise the letter after the apostrophe becomes its own
term to match.
Follow up to the fix for #461
`Artwork::GetAllByFilter()` is already removing diacritics from search
terms, and `UrlName` stores the artist's name with diacritics removed by
calling `Formatter::MakeUrlSafe()`.
Keeping the search by `Name` because `Formatter::MakeUrlSafe()` makes
other changes to the name, too.
Fixes#461
Instead of `USING(EbookId)`, it would be easier to handle
`MultiTableSelect` queries in `FromMultiTableRow()` if the queries used
`ON Projects.EbookId = Ebooks.Ebooks`
This is because `USING` will return only one `EbookId` column, but `ON`
will return all columns from both tables.