-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
54 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.8.5 | ||
0.8.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,15 @@ <h1>elasticlunr</h1> | |
</div> | ||
<div class="span9"> | ||
<section id="Main"><h1>Elasticlunr.js</h1> | ||
<p><a href="https://travis-ci.org/weixsong/elasticlunr.js"><img src="https://travis-ci.org/weixsong/elasticlunr.js.svg?branch=master" alt="Build Status"></a></p><p>Elasticlunr.js is a lightweight full-text search engine developed in JavaScript for browser search and offline search.<br />Elasticlunr.js is developed based on Lunr.js, but more flexible than lunr.js. Elasticlunr.js provides Query-Time boosting, field search, more rational scoring/ranking methodology, fast computation speed and so on.<br />Elasticlunr.js is a bit like Solr, but much smaller and not as bright, but also provide flexible configuration, query-time boosting, field search and other features.</p><h1>Key Features Comparing with Lunr.js</h1> | ||
<p><a href="https://travis-ci.org/weixsong/elasticlunr.js"><img src="https://travis-ci.org/weixsong/elasticlunr.js.svg?branch=master" alt="Build Status"></a></p><p>Elasticlunr.js is a lightweight full-text search engine developed in JavaScript for browser search and offline search.<br />Elasticlunr.js is developed based on Lunr.js, but more flexible than lunr.js. Elasticlunr.js provides Query-Time boosting, field search, more rational scoring/ranking methodology, fast computation speed and so on.<br />Elasticlunr.js is a bit like Solr, but much smaller and not as bright, but also provide flexible configuration, query-time boosting, field search and other features.</p><h1>Why You Need Lightweight Offline Search?</h1> | ||
<ol> | ||
<li>In some system, you don't want to deploy any <strong>complex full-text search engine</strong>(such as Lucence, Elasticsearch, Sphinx, etc.), you only want to provide some static web pages and provide search functionality , then you could build index in previous and load index in client side(such as Browser).</li> | ||
<li>Provide offline search functionality. For some documents, user usually download these documents, you could build index and put index in the documents package, then provide offline search functionality.</li> | ||
<li>For some limited or restricted network, such WAN or LAN, offline search is a better choice.</li> | ||
<li>For mobile device, Iphone or Android phone, network traffic maybe very expensive, then provide offline search is a good choice.</li> | ||
<li>If you want to provide search functionality in your Node.js system, and you don't want to use a complex system, or you only need to support thousands of documents, then Elasticlunr.js is what you want to use.</li> | ||
</ol> | ||
<h1>Key Features Comparing with Lunr.js</h1> | ||
<ol> | ||
<li><strong>Query-Time Boosting</strong>, you don't need to setup boosting weight in index building procedure, Query-Time Boosting make it more flexible that you could try different boosting scheme.</li> | ||
<li><strong>More Rational Scoring Mechanism</strong>, Elasticlunr.js use quite the same scoring mechanism as Elasticsearch, and also this scoring mechanism is used by lucene. </li> | ||
|
@@ -150,14 +158,7 @@ <h2>Example</h2> | |
}); | ||
</code></pre> | ||
<p>Then elasticlunr.js will not store the JSON documents, this will reduce the index size, but also bring some inconvenience such as update a document or delete a document by document id or reference. Actually most of the time user will not udpate or delete a document from index. </p><p><a href="http://elasticlunr.com/docs/index.html">API documentation</a> is available, as well as a <a href="http://elasticlunr.com/example/index.html">full working example</a>.</p><h2>Description</h2> | ||
<p>Elasticlunr.js is developed based on Lunr.js, but more flexible than lunr.js. Elasticlunr.js provides Query-Time Boosting, Field Search, more rational scoring/ranking methodology, flexible configuration and so on.<br />A bit like Solr, but much smaller and not as bright, but also provide flexible configuration, query-time boosting, field search, etc.</p><h2>Why</h2> | ||
<ol> | ||
<li>In some system, you don't want to deploy any Web Server(such as Apache, Nginx, etc.), you only provide some static web pages and provide search function in client side. Then you could build index in previous and load index in client side.</li> | ||
<li>Provide offline search functionality. For some documents, user usually download these documents, you could build index and put index in the documents package, then provide offline search functionality.</li> | ||
<li>For some limited or restricted network, such WAN or LAN, offline search is a better choice.</li> | ||
<li>For mobile device, Iphone or Android phone, network traffic maybe very expensive, then provide offline search is a good choice.</li> | ||
</ol> | ||
<h2>Installation</h2> | ||
<p>Elasticlunr.js is developed based on Lunr.js, but more flexible than lunr.js. Elasticlunr.js provides Query-Time Boosting, Field Search, more rational scoring/ranking methodology, flexible configuration and so on.<br />A bit like Solr, but much smaller and not as bright, but also provide flexible configuration, query-time boosting, field search, etc.</p><h2>Installation</h2> | ||
<p>Simply include the elasticlunr.js source file in the page that you want to use it. Elasticlunr.js is supported in all modern browsers.</p><p>Browsers that do not support ES5 will require a JavaScript shim for Elasticlunr.js to work. You can either use <a href="https://github.com/olivernn/augment.js">Augment.js</a>, <a href="https://github.com/kriskowal/es5-shim">ES5-Shim</a> or any library that patches old browsers to provide an ES5 compatible JavaScript environment.</p><h1>Documentation</h1> | ||
<p>This part only contain important apects of elasticlunr.js, for the whole documentation, please go to <a href="http://elasticlunr.com/docs/index.html">API documentation</a>.</p><h2>1. Build Index</h2> | ||
<p>When you first create a index instance, you need to specify which field you want to index. If you did not specify which field to index, then no field will be searchable for your documents.<br />You could specify fields by:</p><pre><code class="lang-javascript">var index = elasticlunr(function () { | ||
|
@@ -290,16 +291,14 @@ <h2>6. Add customized stop words</h2> | |
<li>...</li> | ||
</ul> | ||
<p>Defaultly elasticlunr.js contains <strong>120</strong> stop words, user could decide not use these default stop words or add customized stop words.</p><h3>6.1 Remove default stop words</h3> | ||
<p>You could remove default stop words simply as:</p><pre><code class="lang-javascript">elasticlunr.clearStopWords() | ||
<p>You could remove default stop words simply as:</p><pre><code class="lang-javascript">elasticlunr.clearStopWords(); | ||
</code></pre> | ||
<h3>6.2 Add customized stop words</h3> | ||
<p>User could add a list of customized stop words.</p><pre><code class="lang-javascript">var customized_stop_words = ['an', 'hello', 'xyzabc']; | ||
|
||
elasticlunr.addStopWords(customized_stop_words); | ||
</code></pre> | ||
<h1>Contributing</h1> | ||
<p>See the <a href="CONTRIBUTING.mdown"><code>CONTRIBUTING.mdown</code> file</a>.</p><h1>Donate</h1> | ||
<p>Alipay: [email protected]</p></section> | ||
<p>See the <a href="CONTRIBUTING.mdown"><code>CONTRIBUTING.mdown</code> file</a>.</p></section> | ||
</div> | ||
</div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.