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