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.7.4 to 0.7.5

2

package.json
{
"name": "js-solr-highlighter",
"version": "0.7.4",
"version": "0.7.5",
"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",

@@ -41,3 +41,3 @@ # js-solr-highlighter

## Options
| Field | Type | Description |
| Field | Type | Description |
| ---- | ---- | ---- |

@@ -52,4 +52,14 @@ | validFields | array | validFields are those parsed as fields.<br />If undefined, all will be parsed as fields if they are like x:x |

## Highlighting rules
| Rule | Examples |
| ---- | ---- |
| If the query has only text and has no fields, highlight each word in it. | If the query is `methylation test`, `methylation` and `test` will be highlighted if they appear in the content. |
| If the field is valid, highlight its value. | If the query is `TITLE:blood` and `TITLE` is a valid field, highlight `blood` if it appears in the content. |
| Do not highlight part of a word in the content. | If the query is `bloo` and the content has no such word but has the word `blood`, do not highlight `bloo` in `blood`. |
| Highlight both the text or field values that the `AND` or `OR` operator takes. | If the query is `blood AND TITLE:cancer` and `TITLE` is a valid field, highlight both `blood` and `cancer` in the content if they exist. |
| Do not highlight the text or field value that the `NOT` operator takes. | If the query is `NOT blood AND cancer`, highlight `cancer` but not `blood`. |
| Highlight the text or field values within parentheses. | If the query is `(blood) AND (TITLE:cancer)` and `TITLE` is a valid field, both `blood` and `cancer` will be highlighted if possible. |
| Do not highlight the Solr stop words. | If the query is `a theory-based study`, Do not highlight `a` but the other words. |
| If the text or the value of a valid field is within parentheses, highlight the EXACT text/value. | If the query is `"breast cancer"`, do not highlight `breast` or `cancer` if it only appears as the single word without the other following or being followed. |
## 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