Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-21-2023, 10:42 PM   #1
droopy
Guru
droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.
 
Posts: 834
Karma: 2912460
Join Date: Apr 2009
Device: Kobo Forma
Full-text search can't handle single-quote mark in a phrase (e.g. golfer's elbow)

why can't calibre full-text search for "golfer's elbow" (quotes in search)? I have books with that phrase. Does Calibre full-text search have a hard time with single quote marks in the search?
droopy is offline   Reply With Quote
Old 10-21-2023, 10:43 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,519
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
full text search is based on words, it doesnt support punctuation of any kind, and that limitataion comes from the sqlite fts engine.
kovidgoyal is offline   Reply With Quote
Old 10-21-2023, 10:53 PM   #3
droopy
Guru
droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.
 
Posts: 834
Karma: 2912460
Join Date: Apr 2009
Device: Kobo Forma
hi kovid,
thanks for your reply.
so how do you propose full-text-searching for the phrase [golfer's elbow] ?
droopy is offline   Reply With Quote
Old 10-21-2023, 11:25 PM   #4
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 47,493
Karma: 171313058
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Why not enclose the search in "s ( i.e. "golfer's elbow" ). That works for me when searching for year's best for example. See attached image.
Attached Thumbnails
Click image for larger version

Name:	calibre_search.png
Views:	85
Size:	126.2 KB
ID:	204378  
DNSB is offline   Reply With Quote
Old 10-25-2023, 07:47 PM   #5
droopy
Guru
droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.
 
Posts: 834
Karma: 2912460
Join Date: Apr 2009
Device: Kobo Forma
Quote:
Originally Posted by kovidgoyal View Post
full text search is based on words, it doesnt support punctuation of any kind, and that limitataion comes from the sqlite fts engine.
Hi Kovid,
Actually, I learned that full-text search, at least in phrases, does support punctuation. But I'm getting ahead of myself. Let's rewind.

FT Search couldn't find any books with
"golfer's elbow"


But it found eight books when it was a curly (a.k.a "smart) apostrophe, as in:
"golfers elbow"
droopy is offline   Reply With Quote
Old 10-25-2023, 07:48 PM   #6
droopy
Guru
droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.
 
Posts: 834
Karma: 2912460
Join Date: Apr 2009
Device: Kobo Forma
Quote:
Originally Posted by DNSB View Post
Why not enclose the search in "s ( i.e. "golfer's elbow" ). That works for me when searching for year's best for example. See attached image.
Hi DNSB, sorry for not being clear. I did enclose my search in quote marks like you did.
droopy is offline   Reply With Quote
Old 10-25-2023, 08:09 PM   #7
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 47,493
Karma: 171313058
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by droopy View Post
Hi Kovid,
Actually, I learned that full-text search, at least in phrases, does support punctuation. But I'm getting ahead of myself. Let's rewind.

FT Search couldn't find any books with
"golfer's elbow"


But it found eight books when it was a curly (a.k.a "smart) apostrophe, as in:
"golfers elbow"
I'm not certain if this would help but one of our devs at work was using tokenchars with the tokenize keyword to add special characters for FTS5 (think it was 5) searches. You might want to check the SQLite FTS5 extension page for more information.

OTOH, I learned some new words from him while he was working on that project.
DNSB is offline   Reply With Quote
Old 10-25-2023, 09:52 PM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,519
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by droopy View Post
Hi Kovid,
Actually, I learned that full-text search, at least in phrases, does support punctuation. But I'm getting ahead of myself. Let's rewind.

FT Search couldn't find any books with
"golfer's elbow"


But it found eight books when it was a curly (a.k.a "smart) apostrophe, as in:
"golfers elbow"
Did you turn on the option to match on related words?
kovidgoyal is offline   Reply With Quote
Old 10-28-2023, 04:46 PM   #9
droopy
Guru
droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.
 
Posts: 834
Karma: 2912460
Join Date: Apr 2009
Device: Kobo Forma
Quote:
Originally Posted by kovidgoyal View Post
Did you turn on the option to match on related words?
No, Kovid, I did not turn it on. Please refer to screenshot of the FTS window
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2023-10-28 13-45-17.png
Views:	66
Size:	187.8 KB
ID:	204463  
droopy is offline   Reply With Quote
Old 10-28-2023, 06:14 PM   #10
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,673
Karma: 7908443
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by droopy View Post
No, Kovid, I did not turn it on. Please refer to screenshot of the FTS window
I didn't know about this typographic difference, thanks.

For what it's worth, I see a different number of results when full-text searching with each apostrophe's variant:

Click image for larger version

Name:	MWSnap 2023-10-28, 19_00_02.png
Views:	64
Size:	56.8 KB
ID:	204465

Click image for larger version

Name:	MWSnap 2023-10-28, 18_57_54.png
Views:	62
Size:	62.2 KB
ID:	204466

Could it be the case that you only have books containing results with the smart apostrophe?

Given the sqlite FTS limitation, I often find myself using the Quality Check Plugin Search ePubs tool, as it can run regex searches. For instance:

(?i)\, though\. gives me results containing the segment ", though."

Sqlite FTS can't do that, unfortunately.
Comfy.n is offline   Reply With Quote
Old 10-28-2023, 06:42 PM   #11
droopy
Guru
droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.
 
Posts: 834
Karma: 2912460
Join Date: Apr 2009
Device: Kobo Forma
Quote:
Originally Posted by Comfy.n View Post
Could it be the case that you only have books containing results with the smart apostrophe?
This is what I am concluding, Comfy.
Thank you for sharing your thoughts. It seems that Calibre's full-text search is particular when it comes to apostrophes. We must do both smart/curly quotes and "dumb" quotes to get all search hits.
droopy is offline   Reply With Quote
Old 10-28-2023, 07:12 PM   #12
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,673
Karma: 7908443
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by droopy View Post
This is what I am concluding, Comfy.
Thank you for sharing your thoughts. It seems that Calibre's full-text search is particular when it comes to apostrophes. We must do both smart/curly quotes and "dumb" quotes to get all search hits.
this would need testing, but I believe that the tool I mentioned can do something like...

golfer’s elbow OR golfer's elbow

maybe:

golfer['’]s elbow
Comfy.n is offline   Reply With Quote
Old 10-28-2023, 10:34 PM   #13
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,519
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by droopy View Post
No, Kovid, I did not turn it on. Please refer to screenshot of the FTS window
Turn it on and try.
kovidgoyal is offline   Reply With Quote
Old 10-29-2023, 07:13 AM   #14
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 14,633
Karma: 108669873
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Quote:
Originally Posted by droopy View Post
This is what I am concluding, Comfy.
Thank you for sharing your thoughts. It seems that Calibre's full-text search is particular when it comes to apostrophes. We must do both smart/curly quotes and "dumb" quotes to get all search hits.
They are different charaters and there is no such thing as a smart quote. Wordprocessors have “smart quoting”, where
' -> ‘ or ’ and is sometimes wrong, messing up ’tis or ’90s
" -> “ or ”
<< ->«
>> -> »
It’s using very simple context and lookup table.

' Typewriter single quote. Something like it can be used in transliterated words or dictionaries. Otherwise only for strings in programming.
‘ open quote
’ close quote or apostrophe
′ single prime (feet, minutes)

" Typewriter double quote. Only for Strings in programming.
“ Open double quote
” Close double quote
(these will be different in German etc)
″ double prime (inches, seconds)

The ` left of 1 is not a quote, it's diacritic and your keyboard map should have it as dead for à è ì ò ù ỳ


Unfortunately people creating or editing metadata can mess up.

Typewriters omitted ‘ ’ “ ” { } [ ] 1 0 (used I and O) and often ! and currency symbols using l backspace . and S, L, Y etc with l, -, = etc.

Last edited by Quoth; 10-29-2023 at 09:38 AM. Reason: Clearer in Georgia font
Quoth is offline   Reply With Quote
Old 10-29-2023, 09:50 AM   #15
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,673
Karma: 7908443
Join Date: Sep 2020
Device: none
Out of curiosity, I tested it this way:

FTS for "year's best" (typewriter's single quote), marked all books, tagged them with year['’]s best

FTS for "year’s best" (apostrophe), marked all books, tagged them with year['’]s best

Then I selected all tagged books and ran these queries with the Search Epubs tool:

year[']s best returned 10 results
year[’]s best returned 68 results

Final step: check if searching for year['’]s best would return the same number, and it found exactly 78 results.

I was under the impression that some books were using both forms in the same edition
Comfy.n is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre freeze when I use full search text with quote ronnydaca Calibre 1 03-18-2023 04:19 PM
Full-text search not really full-text secasa Library Management 5 10-01-2022 10:11 PM
Single-quote/Double-quote Rand Brittain ePub 9 09-01-2011 11:34 AM
HTML2ePub conversion (question mark instead single quote) mikij Calibre 5 08-07-2010 02:15 AM
Google Book Search to search full-text books online Bob Russell Deals and Resources (No Self-Promotion or Affiliate Links) 1 08-19-2006 12:13 PM


All times are GMT -4. The time now is 09:30 AM.


MobileRead.com is a privately owned, operated and funded community.