js-solr-highlighter
Advanced tools
Comparing version 0.6.7 to 0.6.8
{ | ||
"name": "js-solr-highlighter", | ||
"version": "0.6.7", | ||
"version": "0.6.8", | ||
"description": "A JavaScript library for highlighting HTML text based on the query in the lucene/solr query syntax", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
# js-solr-highlighter | ||
A JavaScript library for highlighting HTML text based on the query in the lucene/solr query syntax | ||
## basic usage | ||
### no options | ||
Built based on [lucene](https://github.com/bripkens/lucene "lucene") and [text-annotator](https://github.com/zhan-huang/text-annotator "text-annotator") | ||
The general highlighting process is: | ||
1. Derive which text to highlight from a query in the lucene syntax | ||
2. Highlight the derived text in the HTML | ||
## An example from [Europe PMC](https://europepmc.org "Europe PMC") | ||
js-solr-highlighter has been used to highlight the article titles in the search results of Europe PMC. An example is https://europepmc.org/search?query=blood%20AND%20TITLE%3Acancer | ||
!["an example from Europe PMC" "an example from Europe PMC"](example.JPG) | ||
## Basic usage | ||
### No options | ||
```javascript | ||
@@ -11,3 +20,3 @@ var query = 'cancer AND blood' | ||
``` | ||
### with the validFields options that specify the fields valid in the query syntax. If not specified, all like X:X will be valid fields | ||
### With the validFields options that specify the fields valid in the query syntax. If not specified, all like X:X will be valid fields | ||
```javascript | ||
@@ -21,3 +30,3 @@ var query = 'TITLE:blood AND CONTENT:cell' | ||
``` | ||
### with the highlightedFields options that specify the valid fields whose values will be highlighted. If not specified, the values of all valid fields will be highlighted | ||
### With the highlightedFields options that specify the valid fields whose values will be highlighted. If not specified, the values of all valid fields will be highlighted | ||
```javascript | ||
@@ -31,5 +40,8 @@ var query = 'TITLE:blood OR CONTENT:cell' | ||
``` | ||
## options | ||
## highlighting rules | ||
## contact | ||
Zhan Huang<z2hm@outlook.com> | ||
## Options | ||
## Highlighting rules | ||
## Contact | ||
[Zhan Huang](mailto:z2hm@outlook.com "Zhan Huang") |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
648624
7
45