@backstage/plugin-search-common
Advanced tools
Comparing version 0.3.3 to 0.3.4-next.0
# @backstage/plugin-search-common | ||
## 0.3.4-next.0 | ||
### Patch Changes | ||
- 3a74e203a8: Support generating highlighted matched terms in search result data | ||
- Updated dependencies | ||
- @backstage/plugin-permission-common@0.6.1-next.0 | ||
## 0.3.3 | ||
@@ -4,0 +12,0 @@ |
@@ -17,6 +17,30 @@ /// <reference types="node" /> | ||
* @beta | ||
* Metadata for result relevant document fields with matched terms highlighted | ||
* via wrapping in associated pre/post tags. The UI is expected to parse these | ||
* field excerpts by replacing wrapping tags with applicable UI elements for rendering. | ||
*/ | ||
interface ResultHighlight { | ||
/** | ||
* Prefix tag for wrapping terms to be highlighted. | ||
*/ | ||
preTag: string; | ||
/** | ||
* Postfix tag for wrapping terms to be highlighted. | ||
*/ | ||
postTag: string; | ||
fields: { | ||
/** | ||
* Matched document fields and associated excerpts containing highlighted | ||
* terms wrapped in preTag and postTag to be parsed and rendered in the UI. | ||
*/ | ||
[field: string]: string; | ||
}; | ||
} | ||
/** | ||
* @beta | ||
*/ | ||
interface Result<TDocument extends SearchDocument> { | ||
type: string; | ||
document: TDocument; | ||
highlight?: ResultHighlight; | ||
} | ||
@@ -174,2 +198,2 @@ /** | ||
export { DocumentCollatorFactory, DocumentDecoratorFactory, DocumentTypeInfo, IndexableDocument, IndexableResult, IndexableResultSet, QueryRequestOptions, QueryTranslator, Result, ResultSet, SearchDocument, SearchEngine, SearchQuery, SearchResult, SearchResultSet }; | ||
export { DocumentCollatorFactory, DocumentDecoratorFactory, DocumentTypeInfo, IndexableDocument, IndexableResult, IndexableResultSet, QueryRequestOptions, QueryTranslator, Result, ResultHighlight, ResultSet, SearchDocument, SearchEngine, SearchQuery, SearchResult, SearchResultSet }; |
{ | ||
"name": "@backstage/plugin-search-common", | ||
"description": "Common functionalities for Search, to be shared between various search-enabled plugins", | ||
"version": "0.3.3", | ||
"version": "0.3.4-next.0", | ||
"main": "dist/index.cjs.js", | ||
@@ -42,7 +42,7 @@ "types": "dist/index.d.ts", | ||
"dependencies": { | ||
"@backstage/plugin-permission-common": "^0.6.0", | ||
"@backstage/plugin-permission-common": "^0.6.1-next.0", | ||
"@backstage/types": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"@backstage/cli": "^0.17.0" | ||
"@backstage/cli": "^0.17.1-next.2" | ||
}, | ||
@@ -54,3 +54,3 @@ "jest": { | ||
}, | ||
"gitHead": "e0e44c433319711c2fb8b175db411a621f7aaec2" | ||
"gitHead": "cfbf5762d7d91eee18999306b21d63840400ee29" | ||
} |
25774
199