Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-solr-highlighter

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-solr-highlighter - npm Package Compare versions

Comparing version 0.6.7 to 0.6.8

example.JPG

2

package.json
{
"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")
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc