Skip to content

Commit

Permalink
Version 2.5.0 (#162)
Browse files Browse the repository at this point in the history
### Changes
- Added support for document verticals (#156)
### Fixes
- Upgraded @babel/traverse version to address a vulnerability in the package (#159)
  • Loading branch information
nmanu1 committed Dec 8, 2023
2 parents 4e7a2c2 + 0dc7816 commit 93a8083
Show file tree
Hide file tree
Showing 19 changed files with 382 additions and 205 deletions.
6 changes: 3 additions & 3 deletions THIRD-PARTY-NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ SOFTWARE.

The following NPM package may be included in this product:

- @yext/search-core@2.4.0
- @yext/search-core@2.5.0

This package contains the following license and notice below:

Expand Down Expand Up @@ -134,7 +134,7 @@ THE SOFTWARE.

The following NPM package may be included in this product:

- cross-fetch@3.1.6
- cross-fetch@3.1.8

This package contains the following license and notice below:

Expand Down Expand Up @@ -280,7 +280,7 @@ terms above.

The following NPM package may be included in this product:

- node-fetch@2.6.11
- node-fetch@2.7.0

This package contains the following license and notice below:

Expand Down
13 changes: 13 additions & 0 deletions docs/search-headless.documentresult.documentscore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [DocumentResult](./search-headless.documentresult.md) &gt; [documentScore](./search-headless.documentresult.documentscore.md)

## DocumentResult.documentScore property

The score calculated from whatever document search strategy was used.

<b>Signature:</b>

```typescript
documentScore: number;
```
21 changes: 21 additions & 0 deletions docs/search-headless.documentresult.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [DocumentResult](./search-headless.documentresult.md)

## DocumentResult interface

Details about the document and the document search algorithm

<b>Signature:</b>

```typescript
export declare interface DocumentResult
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [documentScore](./search-headless.documentresult.documentscore.md) | number | The score calculated from whatever document search strategy was used. |
| [segments](./search-headless.documentresult.segments.md) | [Segment](./search-headless.segment.md)<!-- -->\[\] | All the relevant segments extracted from the document. |

13 changes: 13 additions & 0 deletions docs/search-headless.documentresult.segments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [DocumentResult](./search-headless.documentresult.md) &gt; [segments](./search-headless.documentresult.segments.md)

## DocumentResult.segments property

All the relevant segments extracted from the document.

<b>Signature:</b>

```typescript
segments: Segment[];
```
2 changes: 2 additions & 0 deletions docs/search-headless.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
| [DisjunctionStaticFilter](./search-headless.disjunctionstaticfilter.md) | A static filter composed by combining filters with the logical OR operator. The combined filters can either be field value filters or other disjunction filters. |
| [DisplayableFacet](./search-headless.displayablefacet.md) | A [Facet](./search-headless.facet.md) which contains extra fields meant to be displayed to the end user. |
| [DisplayableFacetOption](./search-headless.displayablefacetoption.md) | A [FacetOption](./search-headless.facetoption.md) with extra data meant to be displayed to the end user. |
| [DocumentResult](./search-headless.documentresult.md) | Details about the document and the document search algorithm |
| [EmailDirectAnswer](./search-headless.emaildirectanswer.md) | A [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md) interface with 'email' field type. |
| [Endpoints](./search-headless.endpoints.md) | Overrides for the URLs which are used when making requests to the Search API. |
| [FacebookUrlDirectAnswer](./search-headless.facebookurldirectanswer.md) | A direct answer for a facebook url field. |
Expand Down Expand Up @@ -123,6 +124,7 @@
| [SearchRequest](./search-headless.searchrequest.md) | Options for a Search API request. |
| [SearchService](./search-headless.searchservice.md) | A service which performs Yext Search. |
| [SearchStatusState](./search-headless.searchstatusstate.md) | Maintains the status of the latest search. |
| [Segment](./search-headless.segment.md) | A result produced by a document vertical. |
| [SelectableStaticFilter](./search-headless.selectablestaticfilter.md) | A [StaticFilter](./search-headless.staticfilter.md) with additional information, such as an optional display name and whether or not it is selected. |
| [ServingConfig](./search-headless.servingconfig.md) | The configuration options for getting the endpoints. |
| [SessionTrackingState](./search-headless.sessiontrackingstate.md) | Maintains whether the user session should be tracked and, if so, the session information. |
Expand Down
13 changes: 13 additions & 0 deletions docs/search-headless.result.document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [Result](./search-headless.result.md) &gt; [document](./search-headless.result.document.md)

## Result.document property

A relevant document associated with the result. Present for document verticals grouped by Document.

<b>Signature:</b>

```typescript
document?: DocumentResult;
```
13 changes: 13 additions & 0 deletions docs/search-headless.result.documents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [Result](./search-headless.result.md) &gt; [documents](./search-headless.result.documents.md)

## Result.documents property

All relevant documents associated with the result. Present for document verticals grouped by Entity.

<b>Signature:</b>

```typescript
documents?: DocumentResult[];
```
5 changes: 4 additions & 1 deletion docs/search-headless.result.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ export declare interface Result<T = Record<string, unknown>>
| [description?](./search-headless.result.description.md) | string | <i>(Optional)</i> A description of the result. |
| [distance?](./search-headless.result.distance.md) | number | <i>(Optional)</i> The distance from the user to the result in meters. |
| [distanceFromFilter?](./search-headless.result.distancefromfilter.md) | number | <i>(Optional)</i> The distance from a [AppliedQueryFilter](./search-headless.appliedqueryfilter.md) location to the result in meters. |
| [document?](./search-headless.result.document.md) | [DocumentResult](./search-headless.documentresult.md) | <i>(Optional)</i> A relevant document associated with the result. Present for document verticals grouped by Document. |
| [documents?](./search-headless.result.documents.md) | [DocumentResult](./search-headless.documentresult.md)<!-- -->\[\] | <i>(Optional)</i> All relevant documents associated with the result. Present for document verticals grouped by Entity. |
| [entityType?](./search-headless.result.entitytype.md) | string | <i>(Optional)</i> The entity type of the result. |
| [highlightedFields?](./search-headless.result.highlightedfields.md) | [HighlightedFields](./search-headless.highlightedfields.md) | <i>(Optional)</i> The [highlighted fields](./search-headless.highlightedfields.md) emphasized by the api. |
| [id?](./search-headless.result.id.md) | string | <i>(Optional)</i> The result ID which depends on the Result Source. |
| [index?](./search-headless.result.index.md) | number | <i>(Optional)</i> The index of the result among the other results in the search. |
| [link?](./search-headless.result.link.md) | string | <i>(Optional)</i> A hyperlink associated with the result. |
| [name?](./search-headless.result.name.md) | string | <i>(Optional)</i> The name of the result. |
| [rawData](./search-headless.result.rawdata.md) | T | Raw entity profile data in the shape of key-value pairs. |
| [rawData](./search-headless.result.rawdata.md) | T | Raw entity profile data in the shape of key-value pairs, or as an array of key-value pairs. |
| [segment?](./search-headless.result.segment.md) | [Segment](./search-headless.segment.md) | <i>(Optional)</i> A relevant segment associated with the result. Present for document verticals grouped by Segment. |
| [source](./search-headless.result.source.md) | [Source](./search-headless.source.md) | Represents the source of a [Result](./search-headless.result.md)<!-- -->. |

2 changes: 1 addition & 1 deletion docs/search-headless.result.rawdata.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Result.rawData property

Raw entity profile data in the shape of key-value pairs.
Raw entity profile data in the shape of key-value pairs, or as an array of key-value pairs.

<b>Signature:</b>

Expand Down
13 changes: 13 additions & 0 deletions docs/search-headless.result.segment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [Result](./search-headless.result.md) &gt; [segment](./search-headless.result.segment.md)

## Result.segment property

A relevant segment associated with the result. Present for document verticals grouped by Segment.

<b>Signature:</b>

```typescript
segment?: Segment;
```
21 changes: 21 additions & 0 deletions docs/search-headless.segment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [Segment](./search-headless.segment.md)

## Segment interface

A result produced by a document vertical.

<b>Signature:</b>

```typescript
export declare interface Segment
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [score](./search-headless.segment.score.md) | number | The similarity score of the segment from 0 to 1 |
| [text](./search-headless.segment.text.md) | string | The value of the segment as plain text. |

13 changes: 13 additions & 0 deletions docs/search-headless.segment.score.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [Segment](./search-headless.segment.md) &gt; [score](./search-headless.segment.score.md)

## Segment.score property

The similarity score of the segment from 0 to 1

<b>Signature:</b>

```typescript
score: number;
```
13 changes: 13 additions & 0 deletions docs/search-headless.segment.text.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [Segment](./search-headless.segment.md) &gt; [text](./search-headless.segment.text.md)

## Segment.text property

The value of the segment as plain text.

<b>Signature:</b>

```typescript
text: string;
```
1 change: 1 addition & 0 deletions docs/search-headless.source.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export declare enum Source
| Algolia | <code>&quot;ALGOLIA&quot;</code> | The result is from Algolia. |
| Bing | <code>&quot;BING_CSE&quot;</code> | The result is from Bing Search Engine. |
| Custom | <code>&quot;CUSTOM_SEARCHER&quot;</code> | The result was from a custom source. |
| DocumentVertical | <code>&quot;DOCUMENT_VERTICAL&quot;</code> | The result is from a document vertical. |
| Google | <code>&quot;GOOGLE_CSE&quot;</code> | The result is from Google Custom Search Engine. |
| KnowledgeManager | <code>&quot;KNOWLEDGE_MANAGER&quot;</code> | The result is from a Knowledge Graph. |
| Zendesk | <code>&quot;ZENDESK&quot;</code> | The result is from Zendesk. |
Expand Down
16 changes: 16 additions & 0 deletions etc/search-headless.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@ export interface DisplayableFacetOption extends FacetOption {
selected: boolean;
}

// @public
export interface DocumentResult {
documentScore: number;
segments: Segment[];
}

// @public
export interface EmailDirectAnswer extends BaseFieldValueDirectAnswer<string[]> {
// (undocumented)
Expand Down Expand Up @@ -692,13 +698,16 @@ export interface Result<T = Record<string, unknown>> {
description?: string;
distance?: number;
distanceFromFilter?: number;
document?: DocumentResult;
documents?: DocumentResult[];
entityType?: string;
highlightedFields?: HighlightedFields;
id?: string;
index?: number;
link?: string;
name?: string;
rawData: T;
segment?: Segment;
source: Source;
}

Expand Down Expand Up @@ -842,6 +851,12 @@ declare namespace searchUtilities {
}
export { searchUtilities }

// @public
export interface Segment {
score: number;
text: string;
}

// @public
export interface SelectableStaticFilter {
displayName?: string;
Expand Down Expand Up @@ -889,6 +904,7 @@ export enum Source {
Algolia = "ALGOLIA",
Bing = "BING_CSE",
Custom = "CUSTOM_SEARCHER",
DocumentVertical = "DOCUMENT_VERTICAL",
Google = "GOOGLE_CSE",
KnowledgeManager = "KNOWLEDGE_MANAGER",
Zendesk = "ZENDESK"
Expand Down
Loading

0 comments on commit 93a8083

Please sign in to comment.