@@ -507,6 +507,127 @@ Content-type: application/json
507
507
]
508
508
}
509
509
```
510
+ ## Example 7: Search for content with specific content properties in response body
511
+
512
+ This example queries container content by specific words and requires the response to include all specified attributes on the content.
513
+
514
+ ### Request
515
+
516
+ ``` HTTP
517
+ POST /search/query
518
+ Content-Type: application/json
519
+
520
+ {
521
+ "requests": [
522
+ {
523
+ "entityTypes": [
524
+ "driveItem"
525
+ ],
526
+ "query": {
527
+ "queryString": "Everything about contoso"
528
+ },
529
+ "sharePointOneDriveOptions": {
530
+ "includeHiddenContent": true
531
+ },
532
+ "fields": [
533
+ "SampleOWSText",
534
+ "id",
535
+ "name",
536
+ "parentReference",
537
+ "file",
538
+ "folder",
539
+ "webUrl",
540
+ "createdDateTime",
541
+ "lastModifiedDateTime",
542
+ "size",
543
+ "fileSystemInfo",
544
+ "createdBy",
545
+ "lastModifiedBy",
546
+ "fileSystemInfo",
547
+ "fileSystemInfo"
548
+ ]
549
+ }
550
+ ]
551
+ }
552
+ ```
553
+
554
+ ### Response
555
+
556
+ ``` HTTP
557
+ HTTP/1.1 200 OK
558
+ Content-type: application/json
559
+
560
+ {
561
+ "@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.searchResponse)",
562
+ "value": [
563
+ {
564
+ "searchTerms": [
565
+ "everything",
566
+ "about",
567
+ "contoso"
568
+ ],
569
+ "hitsContainers": [
570
+ {
571
+ "hits": [
572
+ {
573
+ "hitId": "017JL52SWZQ2M5MULUKFBIL7SZ56EB4V2Z",
574
+ "rank": 1,
575
+ "summary": "Everything about Contoso",
576
+ "resource": {
577
+ "@odata.type": "#microsoft.graph.driveItem",
578
+ "size": 17363,
579
+ "fileSystemInfo": {
580
+ "createdDateTime": "2024-06-20T21:49:03Z",
581
+ "lastModifiedDateTime": "2024-04-01T16:57:00Z"
582
+ },
583
+ "listItem": {
584
+ "@odata.type": "#microsoft.graph.listItem",
585
+ "id": "d69986d9-7451-4251-85fe-59ef881e5759",
586
+ "fields": {
587
+ "sampleOWSText": "Sample Value",
588
+ "id": "AAAAAH_MwHAjYctMtjgTN1cWJnYHAApvY20ubJFGtzLui9sETKcAAAAAASsAAApvY20ubJFGtzLui9sETKcAAAAAJqsAAA2",
589
+ "size": 17363,
590
+ "createdBy": "Dylan Williams"
591
+ }
592
+ },
593
+ "id": "017JL52SWZQ2M5MULUKFBIL7SZ56EB4V2Z",
594
+ "createdBy": {
595
+ "user": {
596
+ "displayName": "Dylan Williams",
597
+
598
+ }
599
+ },
600
+ "createdDateTime": "2024-06-20T21:49:03Z",
601
+ "lastModifiedBy": {
602
+ "user": {
603
+ "displayName": "Dylan Williams",
604
+
605
+ }
606
+ },
607
+ "lastModifiedDateTime": "2024-04-01T16:57:00Z",
608
+ "name": "Constoso Details.docx",
609
+ "parentReference": {
610
+ "driveId": "b!rWzsZXXFWEOeeP31bSE5BTjn_6qC3dFNloUBMv62EMilewHuRwQrQau-zcJu2BT0",
611
+ "id": "017JL52SXQSKBKPB7VKZCJE5ZSWUN4LZDZ",
612
+ "sharepointIds": {
613
+ "listId": "ee017ba5-0447-412b-abbe-cdc26ed814f4",
614
+ "listItemId": "1",
615
+ "listItemUniqueId": "d69986d9-7451-4251-85fe-59ef881e5759"
616
+ },
617
+ "siteId": "contoso.sharepoint.com,65ec6cad-c575-4358-9e78-fdf56d213905,aaffe738-dd82-4dd1-9685-0132feb610c8"
618
+ },
619
+ "webUrl": "https://contoso.sharepointt.com/contentstorage/CSP_65ec6cad-c575-4358-9e78-fdf56d213905/Document Library/Constoso Details.docx"
620
+ }
621
+ }
622
+ ],
623
+ "total": 1,
624
+ "moreResultsAvailable": false
625
+ }
626
+ ]
627
+ }
628
+ ]
629
+ }
630
+ ```
510
631
511
632
## Known Limitation
512
633
0 commit comments