Commit graph

2310 commits

Author SHA1 Message Date
Mike Colagrosso
8a4da08a66 Remove non-alphanumerics (except quotes) from search query
That is, don't replace non-alphanumerics with a space. This matches the
behavior of Formatter::RemoveDiacriticsAndNonalphanumerics(), which
would be used here except that function would also remove quotes.  We
actually discussed not introducing spaces previously, but I made a
mistake and didn't apply the same change to the user's search query:

https://github.com/standardebooks/web/pull/470#discussion_r1929591492

This change fixes queries with compound words like:

`Haycraft-Queen`

and also fixes queries for authors with apostrophes:

`O'Neill`

No changes to existing DBs are necessary because they already have terms
like `haycraftqueen` and `oneill` stored in `IndexableCollections` and
`IndexableAuthors`.
2025-03-25 13:16:25 -05:00
Mike Colagrosso
dab857d127 Cast WordCount to string to fix PHPStan error 2025-03-25 13:10:53 -05:00
Alex Cabal
8a3a05a264 Ban ChatGPT user agents 2025-03-24 13:59:13 -05:00
Alex Cabal
ceccd1431e Fail quietly when updating projects with broken URLs instead of logging 2025-03-15 14:18:48 -05:00
Alex Cabal
ba22538659 Add new schema.org wordCount property to ebook view 2025-03-14 12:10:05 -05:00
Alex Cabal
18b462bb52 Fix typo in blog post 2025-03-12 15:01:22 -05:00
Alex Cabal
1385d4bf9f Reveal blog post 2025-03-12 11:44:10 -05:00
Alex Cabal
dc84ff3fa9 Style tweaks 2025-03-10 14:38:54 -05:00
Mike Colagrosso
af956b2714
Replace EbookUrl with EbookId in Artworks (#482)
* Replace `EbookUrl` with `EbookId` in `Artworks`

* Add a `FullUrl` member to `Ebook`

Add documentation about when to use it versus Url.

The full URL is also being used as an ID in RSS feeds, so use `FullUrl` there.

* Store an `EbookId` in `Artworks`
2025-03-10 14:33:20 -05:00
vr8hub
1b6d69c725 Clarify the files excluded from language check 2025-03-10 13:36:07 -05:00
Alex Cabal
5066252355 Use 'insert ... returning' instead of 'Db::GetLastInsertedId()' 2025-03-10 13:03:31 -05:00
Alex Cabal
4446b6d161 Add breadcrumb to new artwork form 2025-03-07 13:40:37 -06:00
Alex Cabal
9eff02db87 Add metadata section to artist page 2025-03-07 11:11:46 -06:00
Alex Cabal
34fd71e55a Tweak wording on delete artist page and add some more breadcrumbs 2025-03-07 10:37:56 -06:00
Alex Cabal
1136cfb2af Add artists rewrites to live site Apache config 2025-03-07 09:57:07 -06:00
Alex Cabal
e76be32463 Add comment 2025-03-07 09:55:54 -06:00
Mike Colagrosso
a91509726c
Add admin tool to handle duplicate artist names (#480) 2025-03-06 14:28:26 -06:00
Alex Cabal
576fcea0b1 Add blog post 2025-03-04 22:47:20 -06:00
Alex Cabal
124e8343fc Completely type hint template functions and switch to named arguments 2025-03-04 20:32:20 -06:00
Alex Cabal
6108b5e53d Tweak step by step guide spelling modernization tip 2025-03-03 14:49:38 -06:00
vr8hub
6f97e557b9 Add manual spelling changes section to Step by Step guide 2025-03-03 14:41:58 -06:00
Weijia Cheng
682f23a1f3 Update step-by-step guide to account for project manager role 2025-03-01 13:47:43 -06:00
Alex Cabal
a019d5e87c Enable some additional PHPStan rules and fix some type issues 2025-03-01 13:39:57 -06:00
Alex Cabal
c9e5026cf4 Add logic for accepting payments from soft credits marked as 'anonymous' 2025-02-28 11:43:39 -06:00
Alex Cabal
7b278da43a Fix broken getter 2025-02-28 11:20:28 -06:00
Alex Cabal
11e5770413 Update Composer dependencies, clean up PHPStan config file, and remove Constants.php from Composer in favor of PHPStan configuration 2025-02-28 10:52:16 -06:00
Alex Cabal
c203de4c6b Set in progress bit when saving ebook placeholder 2025-02-27 23:06:12 -06:00
Alex Cabal
7f5ffb4aea Use shorthand assignment for basic getters 2025-02-27 16:03:26 -06:00
Alex Cabal
99b5fd66f2 More type fixes 2025-02-26 15:17:08 -06:00
Alex Cabal
a5a19f947f More type fixes 2025-02-26 14:32:04 -06:00
Alex Cabal
94d674ef96 Tweak test secrets file 2025-02-26 14:28:01 -06:00
Mike Colagrosso
1eeab11353 Add default values for config vars 2025-02-26 14:17:11 -06:00
Alex Cabal
b6079dbf74 Show reviewer and manager when a new project is created 2025-02-26 08:43:20 -06:00
Alex Cabal
9d1b66d19e Update PHPStan and Safe PHP, and review codebase for further type correctness 2025-02-25 22:41:18 -06:00
Alex Cabal
e2e14a3551 Remove DbConnection class in favor of fully-static and typed Db class 2025-02-25 16:47:25 -06:00
Alex Cabal
0a684facee Simplify exceptions in HttpInput 2025-02-24 14:46:42 -06:00
Alex Cabal
3ff13397f0 Handle case when a fetchin commits from a GitHub repo that has no commits 2025-02-24 11:56:36 -06:00
Bex Edmondson
a0ea3949ac Adding missing </p> closing tag in common-issues-when-working-on-public-domain-ebooks.php 2025-02-22 12:46:04 -06:00
Alex Cabal
e0ebb58934 Remove list of museums from 'how-to' page 2025-02-17 14:17:56 -06:00
Alex Cabal
4746b9b18f Add Richard Connell spreadsheet to list 2025-02-15 12:00:34 -06:00
Alex Cabal
831c1531d8 Minor refactor 2025-02-15 11:44:18 -06:00
Alex Cabal
388dbab1f1 Change indexable properties to private class properties instead of public getters/setters 2025-02-13 22:52:12 -06:00
Mike Colagrosso
d05f0ea3c7 Remove blank line 2025-02-13 13:48:39 -06:00
Mike Colagrosso
804b786065 Keep IndexableText null if it's an empty string
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.
2025-02-13 13:48:39 -06:00
Mike Colagrosso
55e0428006 Add a Default EbookSortType
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.
2025-02-13 13:48:39 -06:00
Mike Colagrosso
a3ce3f1ec1 Make IndexableText optional
Placeholders do not have FullTitle, AlternateTitle, Tags, LocSubjects,
or TocEntries.
2025-02-13 13:48:39 -06:00
Mike Colagrosso
1629d3a1a1 Remove RelevanceScore from the SELECT fields
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
```
2025-02-13 13:48:39 -06:00
Mike Colagrosso
61bbf8f071 Add idxSearchCombined to match multiple fields
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.
2025-02-13 13:48:39 -06:00
Mike Colagrosso
fd3abb568c Remove title, authors, and collections from IndexableText
Those properties are indexed separately. `FullTitle` and
`AlternateTitle` are still indexed here.
2025-02-13 13:48:39 -06:00
Mike Colagrosso
660f8b5e3e RelevanceScore not relevance_score 2025-02-13 13:48:39 -06:00