From b6b0159f6984af56dc97d94bda8f4c26a98d31e0 Mon Sep 17 00:00:00 2001 From: vdarosa Date: Mon, 15 Jul 2024 12:38:41 -0400 Subject: [PATCH 1/2] search-core: Adding Page Number to Segment (#268) * search-core: Adding Page Number to Segment Added an optional parameter called pageNumber to Segments.ts * Automated update to repo's documentation from github action * description: changed the description of the pageNumber variable * Automated update to repo's documentation from github action --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- docs/search-core.segment.md | 1 + docs/search-core.segment.pagenumber.md | 13 +++++++++++++ etc/search-core.api.md | 1 + src/models/searchservice/response/Segment.ts | 4 +++- 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 docs/search-core.segment.pagenumber.md diff --git a/docs/search-core.segment.md b/docs/search-core.segment.md index c8755534..8b3f2570 100644 --- a/docs/search-core.segment.md +++ b/docs/search-core.segment.md @@ -16,6 +16,7 @@ export interface Segment | Property | Type | Description | | --- | --- | --- | +| [pageNumber?](./search-core.segment.pagenumber.md) | number | (Optional) The page number of the document that the segment came from. Populated only for pdf files. | | [score](./search-core.segment.score.md) | number | The similarity score of the segment from 0 to 1 | | [text](./search-core.segment.text.md) | string | The value of the segment as plain text. | diff --git a/docs/search-core.segment.pagenumber.md b/docs/search-core.segment.pagenumber.md new file mode 100644 index 00000000..4c41c12a --- /dev/null +++ b/docs/search-core.segment.pagenumber.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@yext/search-core](./search-core.md) > [Segment](./search-core.segment.md) > [pageNumber](./search-core.segment.pagenumber.md) + +## Segment.pageNumber property + +The page number of the document that the segment came from. Populated only for pdf files. + +Signature: + +```typescript +pageNumber?: number; +``` diff --git a/etc/search-core.api.md b/etc/search-core.api.md index 5a9823ed..fd9230ac 100644 --- a/etc/search-core.api.md +++ b/etc/search-core.api.md @@ -692,6 +692,7 @@ export interface SearchService { // @public export interface Segment { + pageNumber?: number; score: number; text: string; } diff --git a/src/models/searchservice/response/Segment.ts b/src/models/searchservice/response/Segment.ts index bc8c5c8a..3078a2d4 100644 --- a/src/models/searchservice/response/Segment.ts +++ b/src/models/searchservice/response/Segment.ts @@ -7,5 +7,7 @@ export interface Segment { /** The value of the segment as plain text. */ text: string, /** The similarity score of the segment from 0 to 1 */ - score: number + score: number, + /** The page number of the document that the segment came from. Populated only for pdf files. */ + pageNumber?: number } \ No newline at end of file From 666306dfeb381b0ad192a7791d713774fb951df3 Mon Sep 17 00:00:00 2001 From: Victoria DaRosa Date: Mon, 15 Jul 2024 15:13:05 -0400 Subject: [PATCH 2/2] Version bump: Updated version in package.json and package-lock.json --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3f0e9bff..fc9cd15f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@yext/search-core", - "version": "2.5.1", + "version": "2.5.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@yext/search-core", - "version": "2.5.1", + "version": "2.5.2", "license": "BSD-3-Clause", "dependencies": { "@babel/runtime-corejs3": "^7.12.5", diff --git a/package.json b/package.json index bd67c272..add1e65d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@yext/search-core", - "version": "2.5.1", + "version": "2.5.2", "description": "Typescript Networking Library for the Yext Search API", "main": "./dist/commonjs/src/index.js", "module": "./dist/esm/src/index.js",