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 01-09-2014, 07:07 PM   #1
Chris_Snow
Zealot
Chris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipse
 
Posts: 148
Karma: 8170
Join Date: Jul 2013
Device: kobo glo
Adding Two or more Search expressions into one - how?

Greetings,

I have a couple of virtual libraries setup to return a certain set of books. They are pretty basic using two custom columns

1 = Reading List (SE = #yesno:yes)
2 = Ready2Read (SE = #r2ryesno:yes)

There is also a column

3 = Read (SE = #yesnoread:yes)

They are all columns that show a tick, a red circle x, or a blank space as an option.

Now what I'd like to achieve is to alter the above so that when I use the "Ready2Read" virtual library, it will still use the current expression (#r2ryesno:yes), but also Reading List = No and Read = No.

I've tried all sorts of things, but I can't get it to work. These expression things are tough for an old-boy like me

Much appreciated.

(This is by far the hardest part of calibre of me)
Chris_Snow is offline   Reply With Quote
Old 01-09-2014, 07:49 PM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
#r2ryesno:yes and #yesno:no and #yesnoread:no


A cool thing you might not be aware of is the ability to search using the tag browser (click once, and it matches the field, click twice and it matches everything BUT the tag) and chain your searches!!!

If you hold down Ctrl while you select elements in the tag browser, the search will be constructed to match all elements.

There is a button on the bottom, "Alter Tag Browser". It will let you switch between "Search type when selecting multiple items" - "match any of the items" and "match all of the items"
eschwartz is offline   Reply With Quote
Old 01-09-2014, 07:52 PM   #3
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
All you really need to do is use the word "and" to require both searches. The search box uses boolean operators.
eschwartz is offline   Reply With Quote
Old 01-09-2014, 08:02 PM   #4
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,731
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
(#r2ryesno:"true") and (#yesno:"false") and (#yesnoread:"false")

IMO the parentheses make it easier to read

From another old boy - you'll probably find it a lot easier to if you change the name of those variables to in_reading_list, ready_to_read and have_read

Last edited by BetterRed; 01-09-2014 at 08:05 PM.
BetterRed is offline   Reply With Quote
Old 01-09-2014, 08:04 PM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,731
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by eschwartz View Post
#r2ryesno:yes and #yesno:no and #yesnoread:no


A cool thing you might not be aware of is the ability to search using the tag browser (click once, and it matches the field, click twice and it matches everything BUT the tag) and chain your searches!!!

If you hold down Ctrl while you select elements in the tag browser, the search will be constructed to match all elements.

There is a button on the bottom, "Alter Tag Browser". It will let you switch between "Search type when selecting multiple items" - "match any of the items" and "match all of the items"
Fairly certain Yes/No columns don't show in tag bruiser
BetterRed is offline   Reply With Quote
Old 01-09-2014, 09:13 PM   #6
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by BetterRed View Post
Fairly certain Yes/No columns don't show in tag bruiser
Didn't know, don't use them.
eschwartz is offline   Reply With Quote
Old 01-09-2014, 09:16 PM   #7
Chris_Snow
Zealot
Chris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipse
 
Posts: 148
Karma: 8170
Join Date: Jul 2013
Device: kobo glo
Hey Guys...I thought this was an English forum Not sure what language you're speaking

Thx for the help. I'll try some of these suggestions and see how I go. I have fairly basic needs as far as calibre goes, but with each little thing I learn, I realise it can do so much more. Knowing what to do with it all is also something I have to think about. I don't use the tag browser, but maybe I need to give it another look?

Off to try the formulas. Once I see how the expressions are grouped and used, I can usually suss things myself. Thx.

Edit: One more thing...what do you use to call the blank space? (They are all columns that show a tick, a red circle x, or a blank space as an option.)

Last edited by Chris_Snow; 01-09-2014 at 09:23 PM.
Chris_Snow is offline   Reply With Quote
Old 01-09-2014, 09:23 PM   #8
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by Chris_Snow View Post
Hey Guys...I thought this was an English forum Not sure what language you're speaking

Thx for the help. I'll try some of these suggestions and see how I go. I have fairly basic needs as far as calibre goes, but with each little thing I learn, I realise it can do so much more. Knowing what to do with it all is also something I have to think about. I don't use the tag browser, but maybe I need to give it another look?

Off to try the formulas. Once I see how the expressions are grouped and used, I can usually suss things myself. Thx.
That's why I give code, explanations and links, all in one. And its not eek, its geek!
eschwartz is offline   Reply With Quote
Old 01-09-2014, 09:46 PM   #9
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by BetterRed View Post
(#r2ryesno:"true") and (#yesno:"false") and (#yesnoread:"false")
"true" and "false" are not the same as "yes" and "no". Or at least they aren't when using three values, which the OP is. "true" means the value has been set and "false" the value hasn't. So:

Code:
#r2ryesno:true
is actually the same as

Code:
#r2ryesno:no or #r2ryesno:yes
Quote:
IMO the parentheses make it easier to read
I agree but not with how you have used them I would write it as:
Code:
#r2ryesno:yes and (#yesno:no and #yesnoread:no)
To me, that makes it clearer what the purpose of the search is. But, reading between the lines of the OP question, I would probably code this as:

Code:
#r2ryesno:yes and not (#yesno:yes or #yesnoread:yes)
And as an example of find those with blank, the following should show all the books that not been set to yes or no for any of the lists:

Code:
#r2ryesno:false and #yesno:false and #yesnoread:false
Quote:
From another old boy - you'll probably find it a lot easier to if you change the name of those variables to in_reading_list, ready_to_read and have_read
I'm definitely with you one this. Clear names make this sort of thing so much easier.

Last edited by davidfor; 01-09-2014 at 10:39 PM. Reason: Had some quotes where they shouldn't have been in the searches.
davidfor is offline   Reply With Quote
Old 01-09-2014, 10:29 PM   #10
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,062
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
it is: true
not "true"

The former is a logical
the later is a string (word)
theducks is offline   Reply With Quote
Old 01-09-2014, 10:36 PM   #11
Chris_Snow
Zealot
Chris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipse
 
Posts: 148
Karma: 8170
Join Date: Jul 2013
Device: kobo glo
Quote:
Originally Posted by eschwartz View Post
That's why I give code, explanations and links, all in one. And its not eek, its geek!
Chris_Snow is offline   Reply With Quote
Old 01-09-2014, 10:44 PM   #12
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by theducks View Post
it is: true
not "true"

The former is a logical
the later is a string (word)
Actually, they both work but the no quotes version is more correct so I have fixed my post.
davidfor is offline   Reply With Quote
Old 01-09-2014, 10:51 PM   #13
Chris_Snow
Zealot
Chris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipseChris_Snow can illuminate an eclipse
 
Posts: 148
Karma: 8170
Join Date: Jul 2013
Device: kobo glo
Okay...I used this first
Code:
#r2ryesno:"true" and #yesnoread:"false" and #yesno:"true"
and it seems to return what I wanted. That is...the book is ready to read...I haven't read it...and yes, it's on my reading list. Great!

But with the expressions that were stated later in the thread I found they didn't work - eg
Code:
#r2ryesno:yes and #yesnoread:no and #yesno:yes
In fact, I haven't been able to get any of them to work using yes or no expressions.

Quote:
...you'll probably find it a lot easier to if you change the name of those variables to in_reading_list, ready_to_read and have_read
Can someone explain how (or where?? ) I use these variables. You're right, they are easier to understand.

I've realised my original problem was that I wasn't using the "and" part of the expression, but I'd like to get this yes/no working if I can.

And...is NOT the expression for the blank space?
Chris_Snow is offline   Reply With Quote
Old 01-09-2014, 10:53 PM   #14
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by Chris_Snow View Post
Can someone explain how (or where?? ) I use these variables. You're right, they are easier to understand.
rename the custom columns
eschwartz is offline   Reply With Quote
Old 01-09-2014, 11:13 PM   #15
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Chris_Snow View Post
Okay...I used this first
Code:
#r2ryesno:"true" and #yesnoread:"false" and #yesno:"true"
and it seems to return what I wanted. That is...the book is ready to read...I haven't read it...and yes, it's on my reading list. Great!

But with the expressions that were stated later in the thread I found they didn't work - eg
Code:
#r2ryesno:yes and #yesnoread:no and #yesno:yes
In fact, I haven't been able to get any of them to work using yes or no expressions.
In what way didn't it work? Did you see an error or didn't it show the books you expected? If the latter, are you sure there are books that match the condition? For this sort of thing, I usually build up the query one step at a time. That way I can check from a previous query if there are results that should be on the next.

So, I would start with "#r2ryesno:yes". Then change to "#r2ryesno:yes and #yesnoread:no" before going to the final query. If that didn't seem to work, I would try "#r2ryesno:yes and #yesno:yes" and look through the list for what should have matched the full query.

Quote:
And...is NOT the expression for the blank space?
From memory, the only way to get the blank is with the "false" comparison. So, "#r2ryesno:false". Or, for the books that have not been assigned to any of the lists:

Code:
#r2ryesno:false and #yesnoread:false and #yesno:false
davidfor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Search expressions icychocolatechip Library Management 6 06-14-2013 01:17 AM
Adding books - need help with regular expressions tweebee Library Management 10 08-05-2011 08:58 PM
Adding private commands to the search bar Leeron Kindle Developer's Corner 8 07-07-2011 02:53 AM
adding paragraphs marks in search/replace bobcdy Sigil 5 06-12-2011 05:18 PM
Custom Regular Expressions for adding book information bigbot3 Calibre 1 12-25-2010 06:28 PM


All times are GMT -4. The time now is 10:40 AM.


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