04-04-2010, 02:17 PM | #1 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
How to search for dates (published or entered)?
There are two date fields in the metadata. Is it possible to search these fields in the search bar? If so, how? Can I find all books published before a certain date or in a specific year? IIRC, in the code, the published date is "pubdate", but
"pubdate:2009" doesn't work. Thanks. |
04-04-2010, 11:11 PM | #2 |
creator of calibre
Posts: 44,356
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
IIRC you can't search on dates, but sorting should do most of what you need.
|
Advert | |
|
04-05-2010, 08:49 AM | #3 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Thanks. Sorting is what I've been doing, and I never really needed searching on dates, but I began to wonder if I was missing something. Recently I started using chaley's new save search functionality and thought I might want a save search for the wife that only showed current news. (BTW, I tested your new recount code on Vista and it worked great - no crashes. OTOH, the old code worked for me, too.)
|
04-05-2010, 09:47 PM | #4 |
creator of calibre
Posts: 44,356
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Thanks for the testing. Always good to have some, as I certainly can't test calibre nearly enough myself
I suppose searching on dates should be implementable, in fact you should be able to do it yourself. I suggest the following syntax Code:
pubdate:(><=)YYYY-MM-DD Similarly for date: Last edited by kovidgoyal; 04-06-2010 at 04:16 AM. |
04-05-2010, 11:34 PM | #5 |
Guru
Posts: 644
Karma: 1242364
Join Date: May 2009
Location: The Right Coast
Device: PC (Calibre), Nexus 7 2013 (Moon+ Pro), HTC HD2/Leo (Freda)
|
Do I need to include the actual frowning "smiley" image as shown in your post? Or will typing the colon followed by an open parenthesis be sufficient?
|
Advert | |
|
04-06-2010, 10:29 AM | #6 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
I think he was suggesting I write code to implement this, if I want it (and he was suggesting what the search should look like). And yes, I think the frown face should be required!
|
04-06-2010, 06:28 PM | #7 | |
Grand Sorcerer
Posts: 11,942
Karma: 7219261
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Given 30 seconds of thought, I think that if one does a equal-length substring match, everything works. pubdate:OP2000 would compare 4 characters. ..:OP2000-10 would compare 7. This should work with all the relational comparisons. While at it, whoever does this should implement all the relational operators (=, >, <. !=. >=. <=). In addition, comparison strings that aren't valid dates (e.g., 2000-88-54) should raise PARSE_ERROR, which would indicate that the search has an error (search bar becomes pink). |
|
04-06-2010, 07:55 PM | #8 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Oh I disagree. It looks like it would take superhuman abilities to figure out how to do this. Anyone who accomplished such a feat of programming would be legendary. (Does anyone have a bucket of paint and a fence they need whitewashed)
Quote:
|
|
04-07-2010, 04:31 AM | #9 | |
Grand Sorcerer
Posts: 11,942
Karma: 7219261
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
On a more serious note, do open a ticket and assign it to me. Given that I have just been into the guts of the search stuff and hope that I haven't yet forgotten how it works, it does make sense for me to do the work. I won't need your whitewash. |
|
04-07-2010, 07:54 AM | #10 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
This was in the back of my mind. You've got to be familiar with this part of the code after doing the regex search and exact match coding. Seriously, it wasn't that I had a burning desire for this capability, I just thought it was implemented already and that I didn't know the command syntax.
I'm out of the hospital and back at work full time, so my development time is very limited. I'm not a programmer, just a interested amateur who likes adding features to a worthy project. I sometimes suspect my amateur efforts take Kovid more time than to fix than if he wrote from scratch. Feel free to add the bug ticket and take this on if you think it's worthwhile. I hesitate to do it, as I don't want to make requests unless I really want the feature, and when I really want it, I feel obligated to do it myself. Why ask someone else to do work I'm not willing to do myself? After my merge code gets added (or rejected) I'll choose another project to do. Perhaps it will be this, but I suspect it will be something more closely related to the Add record code and merge code that I've become familiar with. Of course, if you want me to add the ticket for this feature, I'll be happy to do that, but only if you think it's worthwhile and you want to tackle it. If you have any other project that is of more interest, tackle that one first. (I like your proposed variable content tag project a lot, it's more interesting than this one, and I know it's a big one). I hope you liked my whitewash quote - after all - this is an ebook forum and a quoting a bit of a classic struck me as appropriate. |
04-07-2010, 09:55 AM | #11 | |
Well trained by Cats
Posts: 30,377
Karma: 58053698
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
The only date (really a: Timestamp field ) I found in the metadata.db (metadata_sqlite.sql) structure was in the Books table |
|
04-07-2010, 11:43 AM | #12 |
Wizard
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
Timestamp and pubdate both appear to be fields in the books table (which seems the logical place to hold them). I assume the first is when the book was added to Calibre and the second the publication date.
|
04-07-2010, 04:07 PM | #13 | |
Grand Sorcerer
Posts: 11,942
Karma: 7219261
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
I am submitting ticket with the code now. |
|
04-07-2010, 05:12 PM | #14 | ||
Grand Sorcerer
Posts: 11,942
Karma: 7219261
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
- have one of four data types (text, bool, date, number) - can be created and populated - can be positioned and sized - can be hidden and re-enabled - can be deleted - can be directly edited, with appropriate completion - can be edited using the metadata editor. What I have left to do is the GUI dialog box that permits a 'normal' user to create a tag column. The tag browser work to separate tags into categories is no longer necessary, although I think I will do it anyway. I will probably give something to Kovid this weekend. This isn't a small change, so I imagine that he will spend some time looking at and fixing what I have done. Quote:
|
||
04-07-2010, 05:13 PM | #15 | |
Well trained by Cats
Posts: 30,377
Karma: 58053698
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Before the great and nifty Catalog by Ryker, I played around with the Command line DB export and saw the time as part of the field. I usually update the date when I make major changes to the contents of a title since the "data" table does not have a timestamp for each book format when added/updated. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to remove dates from news feed | vega07 | Calibre | 11 | 07-26-2010 06:25 PM |
Article Dates with parse_index | EnergyLens | Calibre | 6 | 04-21-2010 10:13 PM |
Kindle 2 Shipping Dates | Cutestory | Amazon Kindle | 29 | 02-13-2009 11:30 AM |
Dates in Russian (?) | Roger Wilmut | Calibre | 10 | 11-24-2008 06:22 PM |
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 |