Book Section - Book Title not searchable as Title.

I was navigating around the tables in the sqlite db, and I noticed that [fields] has [title] and [bookTitle]. This made me wonder whether or not [bookTitles] were collapsed in to titles for the purpose of an advanced search.

It wasn't.

----

Repro:
1. Create a book and book section.
2. In the book for Title add: "Zee Test - Book - Title"
3. In the book-section for Title add: "Zee Test - Section - Title"
4. In the book-section for Book Title add: 'Zee Test - Section - Book Title"
5. Do an advanced search on Title for "zee test".

Expected:
Advanced search to either have a search option for "Book Title" or that "Title" encapsulated "Book Title"

Results:
Neither of the above ...

zee test - book - title and,
zee test - section - title

----

This made me wonder - why not just get rid of [fields].[bookTitle]? It seem what you really want to do is introduce a sub-type of field, not a new field.

In which case the right thing to do is to create a new table like [subfieldtype].This way if a person wants to search all types of titles it can be done by simply joining on the fieldtypeid irregardless of the subfieldtypeid (make it nullable). This makes a lot of sense and allows Short Title & Book Title to be tied to Title. To get this functionality all the UI would need is an extra checkbox in 'Advanced Search' with a description something like ... [x] Search subtypes of field (ie/ Title, Short Title, & Book Title instead of just Title)? .

This would also allow for some other interesting things like, "Date, Publish Date, Re-print Date, etc" and all it costs is an extra table (with probably 3 columns) and an extra column in every table that uses fieldID (baseFieldMappings, fields, itemData, itemTypeFields, & userFieldMask).
  • edited January 5, 2008
    There is a catch of course. If you only use a checkbox (Search subtypes of field) there's no way to exclude a specific sub-type. So it's still best to take all fields, including sub-fields, and enumerate them in the drop-down list.

    I still like the idea of a subtyping especially when I consider the [userFields] table (this would be very interesting indeed)! This way a generic thing like a `title` can be used as a template for user-created field like "Sub-title", "Alternate-title," "Working-title," etc.
  • For the purposes of search (and switching between item types), 'bookTitle' is mapped to 'publicationTitle', not 'title'. You can see the fields that are searched by hovering over the fields in the advanced search drop-down.
  • Handy, thanks Dan.
Sign In or Register to comment.