microsoftgraph / microsoftgraph/msgraph-sdk-php

searchWithQ() returning "General exception while processing"

Open
#1,674 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:waiting-for-triage
Dominant language
PHP
Stars
669
Forks
150
Avg merge
15h 21m
Merged PRs (30d)
3

Description

I am trying to use the search for DriveItems within a SharePoint drive using the searchWithQ() method of this msgraph-sdk-php package.

$filename = "File_1.txt";
$result = $graphServiceClient->drives()->byDriveId('insert-drive-id-here')->items()->byDriveItemId('child-driveitem-id-here')->searchWithQ($filename)->get()->wait();

The library is returning an ApiException with message "General exception while processing". I cannot find any examples of how to search for DriveItems using this searchWithQ() method, and the Microsoft Graph official example looks incomplete:

<?php
use Microsoft\Graph\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->drives()->byDriveId('drive-id')->items()->byDriveItemId('driveItem-id')->searchWithQ('{q}', )->get()->wait();

Is there an official working example of the searchWithQ() functionality?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the searchWithQ() entry point and compare the request produced by the shown PHP call with the Microsoft Graph example. Reproduce the ApiException using the supplied DriveItems search scenario, then determine whether the SDK call or the example is incomplete. Done means the cause is identified and a working usage example or precise fix is established.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.