Skip to content

Commit

Permalink
search-core: Adding Page Number to Segment (#268)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
vdarosa and github-actions[bot] authored Jul 15, 2024
1 parent 54b5cc7 commit b6b0159
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/search-core.segment.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface Segment

| Property | Type | Description |
| --- | --- | --- |
| [pageNumber?](./search-core.segment.pagenumber.md) | number | <i>(Optional)</i> 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. |

13 changes: 13 additions & 0 deletions docs/search-core.segment.pagenumber.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-core](./search-core.md) &gt; [Segment](./search-core.segment.md) &gt; [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.

<b>Signature:</b>

```typescript
pageNumber?: number;
```
1 change: 1 addition & 0 deletions etc/search-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ export interface SearchService {

// @public
export interface Segment {
pageNumber?: number;
score: number;
text: string;
}
Expand Down
4 changes: 3 additions & 1 deletion src/models/searchservice/response/Segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit b6b0159

Please sign in to comment.