Commit graph

25 commits

Author SHA1 Message Date
Ross Chapman 7cca199a11 Merge branch 'main' into let-a-user-search-within-their-books 2023-12-14 10:25:05 -08:00
Ross Chapman aac8aa1adf Fixes formatting 2023-12-06 11:36:15 -08:00
Ross Chapman 979162da10 Uses filters, fixes for any shelf 2023-12-05 19:33:59 -08:00
Ross Chapman b27ed847d5 Fixes result set passed to template 2023-12-05 16:36:58 -08:00
Ross Chapman d93da4e86d Checkpoint 2023-12-05 15:46:08 -08:00
Adeodato Simó e322d3cae1
Do not create a set for already-distinct query result 2023-11-23 23:01:56 -03:00
Joeri de Ruiter 2920973961 Some small improvements to annotations 2023-07-28 20:54:03 +02:00
Joeri de Ruiter f07d7b02f1 Type annotations and related changes for bookwyrm.connectors 2023-07-28 17:43:32 +02:00
Andy Maloney dd23bc4d0f {list} Fix duplicate suggestions in Add Books section
Fixes #2584

(Also fix a spelling mistake in a comment in book_search.py)
2023-01-10 11:08:11 -05:00
Mouse Reeve 47f1865c59 Remove trailing whitespace from queries 2022-11-15 20:09:00 -08:00
Mouse Reeve f0f65b8b73 Python formatting 2022-11-15 20:08:17 -08:00
Mouse Reeve 9185708224 Simplify how default edition is checked
This logic is still totally bonkers, but this change puts a hard limit
on how many iterations the loop can go through and makes the query that
selects which edition to display a little simpler.
2022-11-15 20:05:41 -08:00
Mouse Reeve eb61033626 Simplify identifier searches
This commit removes code that deduplicated search results for identifier
searches. If it was the case that multiple books have the same
identifier, in theory this would produce better search results, but in
practice this doesn't happen very much, is probably worth seeing when
it does, and worsens the performance of identifier search overall.
2022-11-15 19:42:40 -08:00
Hugh Rundle 1ee2ff4811 normalise isbn on local book search
- uppercase ISBN before checking it's a number to account for trailing 'x'
- check maybe_isbn for search_identifiers search. Without this we are only searching external connectors, not locally!
2022-08-30 20:00:09 +10:00
Hugh Rundle 18d3d2f85d linting 2022-08-28 17:30:46 +10:00
Hugh Rundle f219851f3a strip leading and following spaces from ISBN 2022-08-28 17:28:00 +10:00
Hugh Rundle da5fd32196 normalise isbn searching
ISBNs are always numeric except for when the check digit in ISBN-10s is a ten, indicated with a capital X.
These changes ensure that ISBNs are always upper-case so that a lower-case 'x' is not used when searching.

Additionally some ancient ISBNs have been printed without a leading zero (i.e. they only have 9 characters on the physical book). This change prepends a zero if something looks like an ISBN but only has 9 chars.
2022-08-28 11:05:40 +10:00
Mouse Reeve a053f20961 Re-implements return first option
Since we get all the results quickly now, this aggregates all the
results that came back and sorts them by confidence, and returns the
highest confidence result. The confidences aren't great on free text
search, but conceptually that's how it should work at least.

It may make sense to aggregate the search results in all contexts, but
I'll propose that in a separate PR.
2022-05-31 08:20:59 -07:00
Mouse Reeve 2a84c0a370 title author search already working correctly with return first 2021-11-12 13:59:54 -08:00
Mouse Reeve 80c1954aa3 Fixes first_search_result behavior 2021-11-12 13:48:31 -08:00
Mouse Reeve e6e44decf9 Updates migration 2021-09-30 10:47:53 -07:00
Mouse Reeve 8c4cafed79 Fixes formatting isbn endpoint results 2021-09-16 12:53:27 -07:00
Mouse Reeve 18591c7b56 Fixes circular import 2021-09-16 11:30:04 -07:00
Mouse Reeve fbe05623ff Updates first_search_result functionality 2021-09-16 11:07:36 -07:00
Mouse Reeve 98325818b2 Display search results in api mode and regular 2021-09-16 10:44:33 -07:00