genres and search

Bug #1032746 reported by rich
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Charles Haley

Bug Description

Latest Portable Version 8.63 , win7.64HP

1/ Search genre "Non-Fiction" and key word - gives results that include genre Fiction

2/ i have the following genres
Fiction
Reference
Reference.autobios
Reference.Cooking

I set up a new genre

Reference.Richard

It doesnt sit under Reference but as a new separate main genre so it looks like this

Fiction
Reference
Reference.Richard
Reference
Reference.autobios
Reference.Cooking

Related branches

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1032746

Changing the component for this bug.

 assignee cbhaley
 status triaged

Changed in calibre:
assignee: nobody → Charles Haley (cbhaley)
status: New → Triaged
Revision history for this message
Charles Haley (cbhaley) wrote :

I have no clue what you are trying to say. Please give examples including exact search strings and results.

Revision history for this message
rich (kinokane-calibrebug) wrote :

There are 2 bugs

Bug 2 I have attached images:-

2/ i have the following genres
Fiction
Reference
Reference.autobios
Reference.Cooking

I set up a new genre
Reference.Richard
It doesnt sit under Reference but as a new separate main genre so it looks like this
Fiction
Reference
Reference.Richard
Reference
Reference.autobios
Reference.Cooking

Bug 1

See attached images. (As you can see changing Genre "Reference" to "Non-Fiction" shows bug 2 still present)

Select Genre Non-Fiction and select Tag BANK
Contains the word anyway in the Metatag field.

Gives results shown in 120804235216_8

Select Genre Non-Fiction and select Tag BANK
Equals the word anyway in the Metatag field

Gives results shown in 120804235133_7

Select Genre Non-Fiction and select Tag BANK
Regex the word anyway in the Metatag field

Gives results shown in 120804235049_6

Surely calibre does not consider "Fiction" Is a Subset of "Non-Fiction"?

Cheers

Revision history for this message
Charles Haley (cbhaley) wrote :

For bug 2: my guess is that you have selected "sort by popularity" in the Alter Tag Browser box. Selecting this option prevents tags hierarchies from displaying because the tags are not "properly" together. There is a bug: that calibre even tried to display the hierarchy. I will fix that.

For bug 1: from what I can see, calibre did what you asked it to do. No image shows having asked for "Non-fiction" and getting "Fiction".

In response to your question, yes, calibre considers "Fiction" to be a subset of (to match) "Non-Fiction" if you use a contains search or a non-anchored regular expression search (the kind of regexp search you used). As it says in the manual, "Searches are by default ‘contains’. An item matches if the search string appears anywhere in the indicated metadata.". The word "Non-Fiction" contains the word "Fiction", so it matches.

Use the tag browser to learn how to construct equals-match searches for items in a hierarchy. For example, click once on "Fiction" and you will see a search (there may be typos in what I put here) #genre:"=Fiction". The category in the tag browser will be decorated with one green plus. This search matches any book with the genre "Fiction" having no child categories. Click the category again and you will see the search #genre:"=.Fiction" (note the period after the equals), and the category will be decorated with two green pluses. This search matches books with the genre Fiction either by itself or as a parent. Another search available is #genre:"=..Fiction" (two periods). This search will match the genre "Fiction" occuring as a parent or a child.

Revision history for this message
Charles Haley (cbhaley) wrote :

Fix submitted not to attempt to display hierarchy in the tag browser if categories are not sorted by name.

Changed in calibre:
status: Triaged → Fix Committed
Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in lp:calibre

Fixed in branch lp:calibre. The fix will be in the next release. calibre is usually released every Friday.

 status fixreleased

Changed in calibre:
status: Fix Committed → Fix Released
Revision history for this message
rich (kinokane-calibrebug) wrote :

Thank you for resolving bug 2.

However I am confused re search.

 For example, click once on "Fiction" and you will see a search (there may be typos in what I put here) #genre:"=Fiction". The category in the tag browser will be decorated with one green plus. This search matches any book with the genre "Fiction" having no child categories. Click the category again and you will see the search #genre:"=.Fiction" (note the period after the equals), and the category will be decorated with two green pluses. This search matches books with the genre Fiction either by itself or as a parent. Another search available is #genre:"=..Fiction" (two periods). This search will match the genre "Fiction" occuring as a parent or a child.

That part i understand
120805111541_12

But if i want to martch genre "Non-Fiction" and tag Bank, do i just search in green search bar as per

120805111541_11

or via binoculars icon?

And if i want meet this two conditions and Location=Home what should i do?

Thanks

Revision history for this message
Charles Haley (cbhaley) wrote :

1) Click on "Alter tag browser" -> Match Type -> Match all.
2) Click on "Non-fiction" in the tag browser, probably twice to get matches even if it has children.
3) Holding the shift key, click on "Bank" in the tag browser.
4) If desired, holding the shift key, click on "Home" in location in the tag browser.

If you do all four steps with two clicks in step 2, your search box will contain something like
#genre:"=.Non-Fiction" and #tags:"=Bank" and #location:"=Home"

I suggest that you take further questions on how to search to the mobileread forums. This bug reporting system is not intended for general calibre support. You can also look at the tag browser documentation at http://manual.calibre-ebook.com/gui.html#tag-browser and the search documentation at http://manual.calibre-ebook.com/gui.html#the-search-interface

Revision history for this message
rich (kinokane-calibrebug) wrote :

Thank you for your clear and precision instuctions.

I only found this in the links you sent.

You can perform Actions on sets to books. To select multiple books you can either:
Keep the Ctrl key pressed and click on the books you want selected.
Keep the Shift key pressed and click on the starting and ending book of a range of books you want selected.

You explanation was much better. Sorry I thought this was a bug - I never imagined that a powerful looking search box should not be used ,but instead a counterintuitive Shift key as a file filter which would have to be moved across the thousands on tags on the left hand column.

Only took me a year to discover. I always stuggled with searching and had over 20 separate libraries in order to find what i needed especially with 25 customized columns and 6000 tags.

Thank you again.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.