1 |
|
2 | [travis-url]: https://travis-ci.org/larsvoigt/epub-full-text-search
|
3 | [travis-image]: https://travis-ci.org/larsvoigt/epub-full-text-search.svg?branch=master
|
4 | [![Build Status][travis-image]][travis-url]
|
5 |
|
6 | # EPUB-Search
|
7 | ## Search engine for EPUB3 documents
|
8 |
|
9 | This node module is a search engine for EPUB3 documents. It
|
10 | provides full-text searching on EPUB3 content.
|
11 | It is built on top of [search-index](https://github.com/fergiemcdowall/search-index).
|
12 |
|
13 | ###Features include:
|
14 |
|
15 | * Full text search
|
16 | * Instant search (provide suggestions)
|
17 | * Full javascript
|
18 | * Hits including [cfi](http://www.idpf.org/epub/linking/cfi/epub-cfi.html) references
|
19 |
|
20 | ## Usage
|
21 | ### Create a new search engine object
|
22 | ```javascript
|
23 | var se = new SearchEngine();
|
24 | ```
|
25 | ### Indexing
|
26 |
|
27 | run this function to index your **unzipped** EPUB3 content
|
28 | ```javascript
|
29 | se.indexing('your_epub(s)_directory', function (info) {
|
30 | console.log(info);
|
31 | });
|
32 | ```
|
33 |
|
34 | ### Searching
|
35 |
|
36 | ```javascript
|
37 | // search(query, epubTitle, result_callback)
|
38 | se.search(["epub"], "Accessible EPUB 3", function (results) {
|
39 | });
|
40 | ```
|
41 |
|
42 | ## Installation
|
43 |
|
44 | ## Example
|
45 | Install all dependent modules: ``` npm install ```.
|
46 |
|
47 | Start up the example ```npm run express-service```. It should run an express server on your local machine.
|
48 |
|
49 | When navigating to [http://localhost:8080/](http://localhost:8080/) then you can see a test page where you can enter a search query.
|
50 |
|
51 | Note: The indexing process starts automatically and it takes a few seconds until the search service is really available.
|
52 |
|
53 |
|
\ | No newline at end of file |