[Bug]: Search return wrong result and is extremly slow #1802

Closed
opened 2026-04-24 23:58:35 +02:00 by adam · 5 comments
Owner

Originally created by @Gru0810 on GitHub (Mar 7, 2024).

Describe the issue

When I let run a "search" for "Kommissar" the ABS-WebGui and the App shows me a wrong result and has a extremly long response-time . More then 2 min is normal for the app , 4 minutes was the longest time
Additional I see and hear a lot of HDD-Reading on my NAS

<Devide / System>
Notebook with Google Chrome in house using LAN ABS-WebGui

SearchString = "Kommissar" Test 1 : Notebook in house internal IP-addr using LAN = 57 sec Test 2 : Notebook in house internal IP-addr using LAN = 58 sec Books = 3 Series = 3 ![image](https://github.com/advplyr/audiobookshelf/assets/72630160/0542e58d-b804-47af-ac77-2867dda6a81a) ** Smartphone Android 12, App version 0.9.73-beta** SearchString = "Kommissar" Test 1 : Smartphone in house external IP-addr using WLAN = 2 min 44 sec Test 2 : Smartphone in house external IP-Addr using WLAN = 1 min 55 sec from Test 3 : Smartphone in house internal IP-Addr using WLAN = 1 min 32 sec from Test 4 : Smartphone ext house external IP-Addr using modile-data = **4 min 5 sec** Test 5 : Tablet Xiaomi in house internal IP-addr using WLAN = 1 min 33 sec Test 6 : Tablet Xiaomi in house external IP-addr using WLAN = 1 min 23 sec !!! Books =5 Series = 5 ![Screenshot_20240222_084717_com audiobookshelf app](https://github.com/advplyr/audiobookshelf/assets/72630160/0b40724f-85cb-4f8c-970b-85f46b2e9382)

<Devide / System>
Notebook with MS Access and ODBC-connection to SQlite-Database using LAN

SearchString = "Kommissar" Test 1 "Books" : Notebook in house internal IP-addr using LAN = 2 sec !! Test 2 "Series" : Notebook in house internal IP-addr using LAN = 1 sec !! Books = 54 (SQL = Select ID, Title, CoverPath FROM Books WHERE Title like '%Kommissar%') ![image](https://github.com/advplyr/audiobookshelf/assets/72630160/5ddfd261-aa1f-44fe-bf22-bb2957e134a9)
Series = 9 (SQL = Select ID, Name FROM Series WHERE name like '%Kommissar%')

image

I saved the Result as txt and got 18 MB big file! Duration >1 min ![image](https://github.com/advplyr/audiobookshelf/assets/72630160/356357f4-3e05-4706-b583-97bd9a9b0459)

possible solution:
Add a flag "fast search" -> flagged (default) -> search by using SQL like above( and also in authors) -> extremely fast
"Fast search" unflagged -> deep search also in tracks etc. -> slow

I have 2200 Books , 600 Authors, 300 Series

Steps to reproduce the issue

  1. start a search for a text which you find in book-tilte and series-name
  2. stop the time

Audiobookshelf version

2.8.0

How are you running audiobookshelf?

Docker

Originally created by @Gru0810 on GitHub (Mar 7, 2024). ### Describe the issue When I let run a "search" for "Kommissar" the ABS-WebGui and the App shows me a wrong result and has a extremly long response-time . More then 2 min is normal for the app , 4 minutes was the longest time Additional I see and hear a lot of HDD-Reading on my NAS **<Devide / System> Notebook with Google Chrome in house using LAN ABS-WebGui** <Search> SearchString = "Kommissar" <Duration> Test 1 : Notebook in house internal IP-addr using LAN = 57 sec Test 2 : Notebook in house internal IP-addr using LAN = 58 sec <Result> Books = 3 Series = 3 ![image](https://github.com/advplyr/audiobookshelf/assets/72630160/0542e58d-b804-47af-ac77-2867dda6a81a) **<Devide / System> Smartphone Android 12, App version 0.9.73-beta** <Search> SearchString = "Kommissar" <Duration> Test 1 : Smartphone in house external IP-addr using WLAN = 2 min 44 sec Test 2 : Smartphone in house external IP-Addr using WLAN = 1 min 55 sec from Test 3 : Smartphone in house internal IP-Addr using WLAN = 1 min 32 sec from Test 4 : Smartphone ext house external IP-Addr using modile-data = **4 min 5 sec** Test 5 : Tablet Xiaomi in house internal IP-addr using WLAN = 1 min 33 sec Test 6 : Tablet Xiaomi in house external IP-addr using WLAN = 1 min 23 sec !!! <Result> Books =5 Series = 5 ![Screenshot_20240222_084717_com audiobookshelf app](https://github.com/advplyr/audiobookshelf/assets/72630160/0b40724f-85cb-4f8c-970b-85f46b2e9382) **<Devide / System> Notebook with MS Access and ODBC-connection to SQlite-Database using LAN** <Search> SearchString = "Kommissar" <Duration> Test 1 "Books" : Notebook in house internal IP-addr using LAN = 2 sec !! Test 2 "Series" : Notebook in house internal IP-addr using LAN = 1 sec !! <Result> Books = 54 (SQL = Select ID, Title, CoverPath FROM Books WHERE Title like '%Kommissar%') ![image](https://github.com/advplyr/audiobookshelf/assets/72630160/5ddfd261-aa1f-44fe-bf22-bb2957e134a9) Series = 9 (SQL = Select ID, Name FROM Series WHERE name like '%Kommissar%') ![image](https://github.com/advplyr/audiobookshelf/assets/72630160/ff41cfcc-da46-411d-b0d7-2c95c2032f8a) <API-Call> I saved the Result as txt and got 18 MB big file! <Microsoft Edge Browser> Duration >1 min ![image](https://github.com/advplyr/audiobookshelf/assets/72630160/356357f4-3e05-4706-b583-97bd9a9b0459) possible solution: Add a flag "fast search" -> flagged (default) -> search by using SQL like above( and also in authors) -> extremely fast "Fast search" unflagged -> deep search also in tracks etc. -> slow I have 2200 Books , 600 Authors, 300 Series ### Steps to reproduce the issue 1. start a search for a text which you find in book-tilte and series-name 2. stop the time ### Audiobookshelf version 2.8.0 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:58:35 +02:00
adam closed this issue 2026-04-24 23:58:35 +02:00
Author
Owner

@mikiher commented on GitHub (Mar 12, 2024):

Hi,

On which system is your docker running?
Is Audiobookshelf's config directory local (running on docker's local file system) or remote?

@mikiher commented on GitHub (Mar 12, 2024): Hi, On which system is your docker running? Is Audiobookshelf's config directory local (running on docker's local file system) or remote?
Author
Owner

@Gru0810 commented on GitHub (Mar 13, 2024):

ABS runs by Docker on a Synology NAS DS216+, 1 GB RAM
normal use give me this: CPU 3% RAM ~57% ofer the whole NAS. when I search for "Kommissar" with in WebGUI connected over LAN with the NAS I got this : CPU 47% RAM 58% in all , CPU 0.4%!! , 151 MB by ABS:
image
But as I wrote above during the whole time where the line is flat I see and hear a lot of hard disk reading.
I'm not familiar with JAVA but very much with VBA. But I want to try to dive into ABS code. Can you tell me where I can find the code for "Searching"? Does it always use the API? If yes where I can find the code about the API behind "GET https://abs.example.com/api/libraries//search?"

@Gru0810 commented on GitHub (Mar 13, 2024): ABS runs by Docker on a Synology NAS DS216+, 1 GB RAM normal use give me this: CPU 3% RAM ~57% ofer the whole NAS. when I search for "Kommissar" with in WebGUI connected over LAN with the NAS I got this : CPU 47% RAM 58% in all , CPU 0.4%!! , 151 MB by ABS: ![image](https://github.com/advplyr/audiobookshelf/assets/72630160/28006df0-df65-411c-a40b-46f1253ab146) But as I wrote above during the whole time where the line is flat I see and hear a lot of hard disk reading. I'm not familiar with JAVA but very much with VBA. But I want to try to dive into ABS code. Can you tell me where I can find the code for "Searching"? Does it always use the API? If yes where I can find the code about the API behind "GET https://abs.example.com/api/libraries/<ID>/search?<q>"
Author
Owner

@nichwall commented on GitHub (Mar 13, 2024):

You're probably running into issues with ABS needing to convert everything back to the old API version for the clients (the database model was updated in 2.3.x but a new API version still hasn't been written) because you have a larger library. This requires more CPU to do the conversion in memory after loading the response from the database.

https://github.com/advplyr/audiobookshelf/blob/master/server%2Fcontrollers%2FLibraryController.js which calls https://github.com/advplyr/audiobookshelf/blob/master/server%2Futils%2Fqueries%2FlibraryItemFilters.js#L177 which calls https://github.com/advplyr/audiobookshelf/blob/master/server%2Futils%2Fqueries%2FlibraryItemsBookFilters.js#L954

With ~500 books in my library, searches are all taking less than a few seconds including travel time for the connection from a mobile connection away from home. The database and all books are on a local HDD.

@nichwall commented on GitHub (Mar 13, 2024): You're probably running into issues with ABS needing to convert everything back to the old API version for the clients (the database model was updated in 2.3.x but a new API version still hasn't been written) because you have a larger library. This requires more CPU to do the conversion in memory after loading the response from the database. https://github.com/advplyr/audiobookshelf/blob/master/server%2Fcontrollers%2FLibraryController.js which calls https://github.com/advplyr/audiobookshelf/blob/master/server%2Futils%2Fqueries%2FlibraryItemFilters.js#L177 which calls https://github.com/advplyr/audiobookshelf/blob/master/server%2Futils%2Fqueries%2FlibraryItemsBookFilters.js#L954 With ~500 books in my library, searches are all taking less than a few seconds including travel time for the connection from a mobile connection away from home. The database and all books are on a local HDD.
Author
Owner

@Gru0810 commented on GitHub (Mar 14, 2024):

So what is the best solution for me?
I bought my NAS in 2016! So it pretty old and I planed to buy a new NAS Synology DS224+ with more RAM and import all my 2250 audiobooks in blocks of 50 one again into the new NAS.
Would this solve my performance problem?
But how can I transfer all Author-Info incl picture and all progress and finishedAt info?
I currently have 2250 Audiobook with 205'000 mp3 files
Other question : would it increase performante to convert all mp3 into m4b?

@Gru0810 commented on GitHub (Mar 14, 2024): So what is the best solution for me? I bought my NAS in 2016! So it pretty old and I planed to buy a new NAS Synology DS224+ with more RAM and import all my 2250 audiobooks in blocks of 50 one again into the new NAS. Would this solve my performance problem? But how can I transfer all Author-Info incl picture and all progress and finishedAt info? I currently have 2250 Audiobook with 205'000 mp3 files Other question : would it increase performante to convert all mp3 into m4b?
Author
Owner

@Gru0810 commented on GitHub (Apr 11, 2024):

Performance-problem was solved by buying a new NAS ( Synology DS224+), install MediaServer 2.8.1 and re-create all opf-files, copy and scan all 2500 audiobook in blocks of 100 audiobooks ( duration ~5-8 min !!!)

@Gru0810 commented on GitHub (Apr 11, 2024): Performance-problem was solved by buying a new NAS ( Synology DS224+), install MediaServer 2.8.1 and re-create all opf-files, copy and scan all 2500 audiobook in blocks of 100 audiobooks ( duration ~5-8 min !!!)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1802