View Single Post
Old 09-14-2025, 04:06 PM   #1
Far_Pen_6884
Enthusiast
Far_Pen_6884 began at the beginning.
 
Posts: 31
Karma: 10
Join Date: Jul 2025
Device: paperwhite
Question Searching for custom column #rating with calibredb gives unkown sort field

Hi all,

I use a custom boolean/float column named **#rating** (so I can store half-star values) instead of Calibre’s built-in rating column. When I try to search and sort by that custom column from the command line with calibredb I get errors like:
  • "Unknown sort field: #rating"
  • "Unknown fields: #rating"

Examples:

This fails:

Code:
calibredb list --search '#rating:True' --fields=rating,title,authors --sort-by='#rating'
Unknown sort field: #rating
This also fails:
Code:
calibredb list --search '#rating:True' --fields=#rating,title,authors --sort-by=rating
Unknown fields: #rating
This works but is useless to me because it shows the built-in column (all None for my books):
Code:
calibredb list --search '#rating:True' --fields=rating,title,authors --sort-by=rating
What I want
  • Search for books that have a value in my custom **#rating** column.
  • List title/authors and the custom **#rating** value.
  • Sort the results by my custom **#rating** values (in descending order).

Notes / what I’ve tried
  • I’ve tried quoting the column name, with and without the leading hash, and with/without spaces.
  • I’ve tried using the GUI to confirm the custom column name and type — it exists and contains values (including halves like 3.5).
  • I suspect calibredb either doesn’t accept custom column names with a leading “#” for --sort-by, or it expects a different syntax for custom columns.

Is there a supported way to reference custom columns (including those starting with “#”) in calibredb --fields, --search and --sort-by? If so, what is the exact syntax?
Far_Pen_6884 is offline   Reply With Quote