Giter VIP home page Giter VIP logo

Comments (9)

dghag avatar dghag commented on August 26, 2024

Please anyone at least tell me, Is "text search" possible or not??

from epub.js.

fchasen avatar fchasen commented on August 26, 2024

For the immediate future search isn't possible, though we are planning to develop a backend to enable it.

It will likely be separate from the ePub.js code, as it will require a python.

from epub.js.

dkurth avatar dkurth commented on August 26, 2024

I wonder if you could build the search indexes using lunr.js. It already supports tokenization, stemming, and stop words. I haven't used it for anything serious, so I don't know about performance, and building the indexes on the client is not optimal, so just a thought.

from epub.js.

fchasen avatar fchasen commented on August 26, 2024

@AJRenold - could you update this thread with the search progress and close?

from epub.js.

AJRenold avatar AJRenold commented on August 26, 2024

We're developing a light-weight indexing and search tool which allows an entire epub file to be searched via a search API. (https://github.com/futurepress/epubjs-search) The reader plugin search.js (https://github.com/futurepress/epub.js/blob/master/reader/plugins/search.js#L4) points to the API endpoint where you must be running a search server with the index of the same book. This model only supports indexing and searching a single book.

I'll update the epubjs-search readme today with better instructions on how to use the library.

from epub.js.

grayxr avatar grayxr commented on August 26, 2024

Please update the epubjs-search readme. Thanks!
@AJRenold @fchasen

By the way, would a nice alternative option be to just use the unzipped/decompressed epub folder format and perform a search query that iterates over all of the epub's '.xhtml' files?

from epub.js.

AJRenold avatar AJRenold commented on August 26, 2024

I just updated the epubjs-search README.md with instructions that should get you up and running a simple Python search API.

We are actively considering other options to create a search feature that runs on the client side only.

from epub.js.

fchasen avatar fchasen commented on August 26, 2024

The search engine needs to have a sense of how a epub is put together or it can't generate the Epub CFI and cfi's are what allow the reader to jump to a location in the book.

To briefly describe what the search engine does:

  • Parses the epub spine / manifest
  • Indexs each page that was in the spine along with the spine items cfi position
  • Retrieves pages from the index that match a search query
  • Looks for all the instances in that page of the query and assigns them full cfi's
  • Returns the list of results as json

from epub.js.

shenzhuxi avatar shenzhuxi commented on August 26, 2024

Is lunr.js good for this issue?

from epub.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.