Author Topic: Book Search Issue (Search results sorted by year)  (Read 113 times)

Offline k.rasheva

  • Coccinella
  • *
  • Posts: 5
  • Karma: +0/-0
Book Search Issue (Search results sorted by year)
« on: 20 September 2020, 00:51:52 »
Hello Federica and Dario!
I have recently started using Alexandria book library on my website.  It is an excellent library extension and I have enjoyed creating a library with it.
The only issue I am having is when I use the search menu. I made a "Search" menu item and it works fine in alphabetical mode. I need it open results ordered by the year of the Books. When I make these settings from the menu I see server error 500 or if it works the books are sorted alphabetically. Can you tell me where I have made wrong?

Thank you in advance!
Best regards!
Katia

Vox Populi(x) forum

Book Search Issue (Search results sorted by year)
« on: 20 September 2020, 00:51:52 »

Offline federica

  • Amministratore
  • Delfino
  • *****
  • Posts: 1.052
  • Karma: +1/-0
Re: Book Search Issue (Search results sorted by year)
« Reply #1 on: 27 September 2020, 10:50:00 »
Hi Katia,
search by year is based on field "Year" (year of publication), not by "Date insert". Have you filled in "year" field?

If you like Abook, please add a review on "joomla extension directory" https://extensions.joomla.org/extension/alexandria-book-library/ . i will appreciate it very much. Your review will helps other people!
Al mondo ci sono 10 tipi di persone, quelli che hanno capito il codice binario e quelli che non l'hanno capito.
http://www.antivirushelp.it
stacca la spina!

Vox Populi(x) forum

Re: Book Search Issue (Search results sorted by year)
« Reply #1 on: 27 September 2020, 10:50:00 »

Offline k.rasheva

  • Coccinella
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Book Search Issue (Search results sorted by year)
« Reply #2 on: 29 September 2020, 13:21:35 »
Hi Katia,
search by year is based on field "Year" (year of publication), not by "Date insert". Have you filled in "year" field?

If you like Abook, please add a review on "joomla extension directory" https://extensions.joomla.org/extension/alexandria-book-library/ . i will appreciate it very much. Your review will helps other people!

I actually created a "Search" button. I would like the books in Search View (and everywhere) to be sorted by "year" without having to use filters. They have currently sorted/ordered alphabetically, not by year. How to make that... Thank you for your support. Best regards! Katia

Offline federica

  • Amministratore
  • Delfino
  • *****
  • Posts: 1.052
  • Karma: +1/-0
Re: Book Search Issue (Search results sorted by year)
« Reply #3 on: 30 September 2020, 21:57:02 »
Go to Abook global Options -> categories then set "Books order"=year
Al mondo ci sono 10 tipi di persone, quelli che hanno capito il codice binario e quelli che non l'hanno capito.
http://www.antivirushelp.it
stacca la spina!

Vox Populi(x) forum

Re: Book Search Issue (Search results sorted by year)
« Reply #3 on: 30 September 2020, 21:57:02 »

Offline k.rasheva

  • Coccinella
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Book Search Issue (Search results sorted by year)
« Reply #4 on: 01 October 2020, 07:55:59 »
Go to Abook global Options -> categories then set "Books order"=year

Thank you for your reply, Federica!
I made this setting before writing to you. I have no idea why this setting is not working on my site. The books are still ordered by name alphabetically. I have books which titles are in Cyrillic, and English titled books. In the Search page,  English books are presented first, then are Cyrillic books, and all of the books are presented alphabetical order... I still don't understand where am I wrong. (Sorry for my English).

Offline k.rasheva

  • Coccinella
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Book Search Issue (Search results sorted by year)
« Reply #5 on: 22 October 2020, 23:31:47 »
Go to Abook global Options -> categories then set "Books order"=year

Unfortunately, this setting does not work on my site. I tried everything - the order of the books is always in alphabetical order from A to Z. I even tried to put the year (which is very important to me) as the starting word of the title - the books are arranged by year (ie by numbers in title), but in the reverse order of what I need (from oldest to newest - for example from 2013 to 2020).

I don't know how to make the library sort the books the way I set it in the settings. I even tried to reinstall the component - nothing changed. What can affect the component? Thank you!

Offline k.rasheva

  • Coccinella
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Book Search Issue (Search results sorted by year)
« Reply #6 on: 23 October 2020, 00:35:07 »
I found the decision in the forum:
...components/com_abook/models/search.php, line 250:
Code: [Select]
// $query->order($db->escape($this->getState('list.ordering', 'a.ordering')).' '.$db->escape($this->getState('list.direction', 'ASC')).', a.title');
// commented out and for instance new:
$query->order($db->escape('a.year DESC'));
$query->order($db->escape('a.pag_index'));
This works! Thanks!