Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-05-2022, 03:43 PM   #1
albell
Member
albell began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Oct 2016
Device: Onyx Boox N96ML
Two suggestions for Full text search

Hi Kovid,

I'm curious to know if you plan to improve the full text search results window sometime in the future.
The whole feature is simply great, but at the moment the most uncomfortable thing to me is the order in which the matched books are displayed: I would not be wrong, but it seems completely random to me, or maybe they follow the date of insertion in Calibre?
Also, unless I have missed something, it is not possible to sort the results in any way. It would be great if matched books were sortable according to various parameters (at least the basic ones: author, tag, date, etc.),
and maybe show them in cover mode, just like in the Powersearch plugin.

Another thing that puzzles me is that if you open a book from the full text search window, the viewer by default searches for the snippet shown in the window. Which is useful, but I would find it more useful that the viewer opened searching the text with the initial query, so that you can immediately see if there are other results besides the first one shown by default by FTS.
I don't know however if it is possible to replicate some types of queries on the viewer (for example the one with NEAR), I've never tried.

Thank you!
albell is offline   Reply With Quote
Old 08-05-2022, 08:45 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
results are sorted by relevance, aka, best match to your query. This is how pretty much all full text searches work. No, I have no plans to implement a cover based view, when searching for text seeing context around the match is far more important. If you want to browse books by some other criteria than relevance, use the mark all button and then switch to the main calibre window, do a search for marked:true and then sort the resulting list however you like.

The viewer cannot search for the original query, since the viewer does not support the same search syntax as the FTS engine.
kovidgoyal is offline   Reply With Quote
Old 08-06-2022, 04:25 AM   #3
albell
Member
albell began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Oct 2016
Device: Onyx Boox N96ML
Quote:
Originally Posted by kovidgoyal View Post
If you want to browse books by some other criteria than relevance, use the mark all button and then switch to the main calibre window, do a search for marked:true and then sort the resulting list however you like.
Thanks, that works perfectly.

Quote:
Originally Posted by kovidgoyal View Post
The viewer cannot search for the original query, since the viewer does not support the same search syntax as the FTS engine.
Yes, that's what I feared.
So in the case of a query with NEAR, having only one occurrence shown in the FTS windows is a bit limiting, since it cannot be replicated on the viewer.
Just out of curiosity: is the choice to show only one result due to performance reasons or other? Will it be tweakable in the future, at least for queries that cannot be replicated on the viewer?

Thank you!
albell is offline   Reply With Quote
Old 08-06-2022, 04:53 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's just how the FTS engine works (indeed most fts engines work). Think of for example a google search. They dont return multiple matches per webpage.

As for replicating near queries, you can do so in the viewer, using regular expressions. So for example to find the words one and two near each other you can search for

(?s)\bone\b.{3,150}\btwo\b

The only caveat is that the numbers above are characters not words, so its not quite as precise as in the FTS search.
kovidgoyal is offline   Reply With Quote
Old 08-06-2022, 10:05 AM   #5
albell
Member
albell began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Oct 2016
Device: Onyx Boox N96ML
Quote:
Originally Posted by kovidgoyal View Post
That's just how the FTS engine works (indeed most fts engines work). Think of for example a google search. They dont return multiple matches per webpage.

As for replicating near queries, you can do so in the viewer, using regular expressions. So for example to find the words one and two near each other you can search for

(?s)\bone\b.{3,150}\btwo\b

The only caveat is that the numbers above are characters not words, so its not quite as precise as in the FTS search.
Thank you, this is a great workaround. Another caveat, I think, is that with regular expression the words are only searched in the order established in the expression, but that's not a big deal.

BTW I have another question:

I noticed that if I perform ocr on a scanned pdf that is already in the library (by launching an external app such as Acrobat), and then I save it overwriting the previous one, this is not automatically indexed and in fact remains "invisible" to FTS engine.
Is there a way to force indexing of a book (other than delete it and re-import it into the library)?

Thank you!
albell is offline   Reply With Quote
Old 08-06-2022, 10:22 AM   #6
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,602
Karma: 61176603
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by albell View Post
BTW I have another question:

I noticed that if I perform ocr on a scanned pdf that is already in the library (by launching an external app such as Acrobat), and then I save it overwriting the previous one, this is not automatically indexed and in fact remains "invisible" to FTS engine.
Is there a way to force indexing of a book (other than delete it and re-import it into the library)?

Thank you!
Right-click in the details pane (or window) and there's an option to re-index.

In the future, copying the PDF file out and then re-adding it via the MDE will trigger the re-index and update the listed filesize.

Last edited by ownedbycats; 08-06-2022 at 10:26 AM.
ownedbycats is offline   Reply With Quote
Old 08-06-2022, 10:52 AM   #7
albell
Member
albell began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Oct 2016
Device: Onyx Boox N96ML
Quote:
Originally Posted by ownedbycats View Post
Right-click in the details pane (or window) and there's an option to re-index.

In the future, copying the PDF file out and then re-adding it via the MDE will trigger the re-index and update the listed filesize.
thanks, I didn't notice that!
albell is offline   Reply With Quote
Old 08-06-2022, 04:29 PM   #8
albell
Member
albell began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Oct 2016
Device: Onyx Boox N96ML
Quote:
Originally Posted by ownedbycats View Post
Right-click in the details pane (or window) and there's an option to re-index.

In the future, copying the PDF file out and then re-adding it via the MDE will trigger the re-index and update the listed filesize.
I did some testing and at the moment this last option is already the only one that works: remove the pdf from the MDE and add it again.
While if you reindex from the book's details pane, it still remains unindexed.
albell is offline   Reply With Quote
Old 08-06-2022, 11:21 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by albell View Post
While if you reindex from the book's details pane, it still remains unindexed.
That is a bug fixed in the next release. You click on the PDF link in the book details panel and choose re-index and it will work.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Full Text Search query DrChiper Calibre 2 07-26-2022 06:31 AM
Full text search? excaliber Library Management 3 08-07-2017 06:09 AM
Full Text Search? silentguy Calibre 4 02-22-2012 03:03 PM
Full Text Search Engine Fat Abe General Discussions 1 09-21-2010 05:30 PM
Google Book Search to search full-text books online Bob Russell Deals and Resources (No Self-Promotion or Affiliate Links) 1 08-19-2006 12:13 PM


All times are GMT -4. The time now is 12:16 PM.


MobileRead.com is a privately owned, operated and funded community.