Skip to content

Commit 36c5449

Browse files
author
Matthew Harris
committed
Page
1 parent 7e1d9ea commit 36c5449

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Azure.AISearch.WebApp/Services/AzureCognitiveSearchConfigurationService.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,9 @@ private SearchIndexerSkillset GetDocumentsSearchIndexerSkillset(AppSettingsOverr
326326
// Pass the document file path.
327327
new InputFieldMappingEntry("filepath") { Source = $"/document/{nameof(Document.FilePath)}" },
328328
// mjh Pass the data source
329-
new InputFieldMappingEntry("data_source") { Source = $"/document/{nameof(Document.DataSource)}" },
329+
new InputFieldMappingEntry("data_source") { Source = $"/document/{nameof(Document.DataSource)}" },
330+
// Pass the document page.
331+
new InputFieldMappingEntry("page") { Source = $"/document/{nameof(Document.Page)}" },
330332
// Pass the field name as a string literal.
331333
new InputFieldMappingEntry("fieldname") { Source = $"='{nameof(Document.Content)}'" },
332334
// Pass the embedding deployment to use as a string literal.

src/Azure.AISearch.WebApp/Services/AzureCognitiveSearchService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public async Task<SearchResponse> SearchAsync(SearchRequest request)
100100
{
101101
answerForDocumentKey.DocumentId = searchResult.DocumentId;
102102
answerForDocumentKey.DocumentTitle = searchResult.DocumentTitle;
103+
answerForDocumentKey.DocumentPage = searchResult.DocumentPage;
103104
}
104105
}
105106
return response;
@@ -137,7 +138,6 @@ private void SetSearchOptionsForChunksIndex(SearchOptions searchOptions, QueryTy
137138
searchOptions.Select.Add(nameof(DocumentChunk.Id));
138139
searchOptions.Select.Add(nameof(DocumentChunk.SourceDocumentId));
139140
searchOptions.Select.Add(nameof(DocumentChunk.SourceDocumentTitle));
140-
searchOptions.Select.Add(nameof(DocumentChunk.SourceDocumentPage));
141141

142142
searchOptions.Select.Add(nameof(DocumentChunk.Content));
143143
if (queryType != QueryType.Vector)

0 commit comments

Comments
 (0)