Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 09-29-2022, 07:03 AM   #1
pinky62
Zealot
pinky62 began at the beginning.
 
Posts: 136
Karma: 10
Join Date: Oct 2013
Device: kindle paper white
Search for one word in longer tags?

Hi I have several tags 3-4 words long. If say sister is a word common to all four tags how can I search all containing this word any where in the entire tag string. So looking for sister, sister is searching for family. If I type sister I want books with either one or both of these tags to show in search? How? TIA
pinky62 is offline   Reply With Quote
Old 09-29-2022, 07:58 AM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by pinky62 View Post
Hi I have several tags 3-4 words long. If say sister is a word common to all four tags how can I search all containing this word any where in the entire tag string. So looking for sister, sister is searching for family. If I type sister I want books with either one or both of these tags to show in search? How? TIA
Without an example it isn't clear to me what you mean. Do you mean something like "sister, family, cat, dog" or do you mean "sister family, cat dog"?

If the first one, where the keywords are separate tags for the book, then use
Code:
tags:=sister or tags:=family
This finds books with either or both of the terms.

The second, where the words are embedded in the same tag, is
Code:
tags:sister or tags:family
This will match "family sister", and also "family, sister". Unfortunately it will also match "sisterhood".
chaley is offline   Reply With Quote
Advert
Old 09-29-2022, 08:34 AM   #3
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,611
Karma: 7891011
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by chaley View Post
The second, where the words are embedded in the same tag, is
Code:
tags:sister or tags:family
This will match "family sister", and also "family, sister". Unfortunately it will also match "sisterhood".
That's quite interesting.

A search for
Code:
title:union
in my Calibre library returns 10 results.

And
Code:
title:"union"
returns the same 10 results, including Road to disunion, Intimate Communion and Reunion Romance Novella. It will also match titles containing unions

Whereas in google searches, double quotes seem to restrict the results to the exact string.

(by the way, title:="union" will also return 10 results)

Last edited by Comfy.n; 09-29-2022 at 08:38 AM.
Comfy.n is offline   Reply With Quote
Old 09-29-2022, 08:43 AM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Comfy.n View Post
That's quite interesting.

A search for
Code:
title:union
in my Calibre library returns 10 results.

And
Code:
title:"union"
returns the same 10 results, including Road to disunion, Intimate Communion and Reunion Romance Novella. It will also match titles containing unions

Whereas in google searches, double quotes seem to restrict the results to the exact string.
This is explained in the calibre documentation . A brief recapitulation:
  • Quoting a search term doesn't change its meaning. The quotes allow you to include spaces. Thus title:union and title:"union" are the same.
  • The search kind controls how matching works. There are 4 kinds. My and your examples use contains matching. Prefixing the search with an equals changes it to exact match.
Quote:
(by the way, title:="union" will also return 10 results)
If quotes are used then the search kind character must be inside the quotes.
chaley is offline   Reply With Quote
Old 09-29-2022, 04:26 PM   #5
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,611
Karma: 7891011
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by chaley View Post
This is explained in the calibre documentation . A brief recapitulation:
  • Quoting a search term doesn't change its meaning. The quotes allow you to include spaces. Thus title:union and title:"union" are the same.
  • The search kind controls how matching works. There are 4 kinds. My and your examples use contains matching. Prefixing the search with an equals changes it to exact match.
If quotes are used then the search kind character must be inside the quotes.
Thanks Chaley. I'm quite familiar with the calibre default search options, but this topic got me wondering if there was some unbeknownst (to me) type of regular search that would return titles containing "union" and not any partial matches.

I'm aware that it's possible to get that by using regex, as in title:~\\bunion\\b , however using regular expressions is painful for non-programmers.
Comfy.n is offline   Reply With Quote
Advert
Old 09-29-2022, 04:29 PM   #6
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Comfy.n View Post
Thanks Chaley. I'm quite familiar with the calibre default search options, but this topic got me wondering if there was some unbeknownst (to me) type of regular search that would return titles containing "union" and not any partial matches.
Exact match searches are "regular searches" (one of the 4). You just need to put the '=' inside the quotes.

EDIT: perhaps I misunderstood. Are you looking for word-level matching, as in "sister" matching "my sister jane" but not "the sisterhood of jane"? If so then as you say, the built-in search types won't help you beyond regex and template searching.

Last edited by chaley; 09-29-2022 at 04:34 PM.
chaley is offline   Reply With Quote
Old 09-29-2022, 05:17 PM   #7
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,611
Karma: 7891011
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by chaley View Post
Exact match searches are "regular searches" (one of the 4). You just need to put the '=' inside the quotes.

EDIT: perhaps I misunderstood. Are you looking for word-level matching, as in "sister" matching "my sister jane" but not "the sisterhood of jane"? If so then as you say, the built-in search types won't help you beyond regex and template searching.
I was just wondering. It's not that I'm looking into a specific use at the moment.

The search title:"=sister" would return a single-word title named "Sister", which don't exist in my library, so if I needed to get results that contain "sister" but not "sisterhood", using regex would be required, as you confirmed.
Comfy.n is offline   Reply With Quote
Old 09-29-2022, 05:39 PM   #8
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,611
Karma: 7891011
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by chaley View Post
If quotes are used then the search kind character must be inside the quotes.
I see that, thanks. I think I was trying to see whether title:="union" would return the same results that title:~\\bunion\\b returns...

title:"=union" (equal sign inside the quotes) isn't useful in that case, as it will return a single-word title
Comfy.n is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Metadata download no longer includes tags wdwyer Library Management 2 06-21-2018 10:20 PM


All times are GMT -4. The time now is 04:14 AM.


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