File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
src/Azure.AISearch.WebApp/Services Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,22 @@ private SearchResult GetSearchResultForChunksIndex(SearchResult<SearchDocument>
181181 //searchResult.Type = result.Document.GetString(nameof(DocumentChunk.SourceDocumentType));
182182 //searchResult.PublishDate = result.Document.GetDateTimeOffset(nameof(DocumentChunk.SourceDocumentPublishDate));
183183 searchResult . DocumentPage = result . Document . GetString ( nameof ( DocumentChunk . SourceDocumentPage ) ) ;
184-
184+
185+ // Extract #page=XX from DocumentPage, which points at blob storage
186+ if ( ! string . IsNullOrWhiteSpace ( searchResult . DocumentPage ) )
187+ {
188+ var match = Regex . Match ( searchResult . DocumentPage , @"#page=(\d+)" ) ;
189+ if ( match . Success )
190+ {
191+ searchResult . DocumentPage = match . Groups [ 1 ] . Value ;
192+ }
193+ }
194+ // Add to source URL
195+ if ( ! string . IsNullOrWhiteSpace ( searchResult . DocumentPage ) )
196+ {
197+ searchResult . DocumentSourceUrl += $ "#page={ searchResult . DocumentPage } ";
198+ }
199+
185200 return searchResult ;
186201 }
187202
You can’t perform that action at this time.
0 commit comments