Giter Club home page Giter Club logo

Comments (8)

YannickRe avatar YannickRe commented on June 7, 2024

I reached out to the Graph Team. $search on anything other than mail or displayName would fallback to a startsWith $filter request. When testing out $filter directly I get an error message from Graph (although the API documentation states that it is supported), which might explain why $search also isn't returning data.

I'll keep you informed!

from spfx-msgraph-peoplesearch.

MMAtHome avatar MMAtHome commented on June 7, 2024

from spfx-msgraph-peoplesearch.

YannickRe avatar YannickRe commented on June 7, 2024

So, this took a while but I come with information 😀.

My tests with $filter were failing because I didn't use the correct magic header parameter (Consistencylevel: eventual) and forgot the $count=true. It also seems that you need to encode the + character in a phone number to %2B, otherwise $filter does not return the expected results.

All of that applies to $search as well BUT it currently only works on the /beta endpoint of Graph, and the team is looking into it 😀.

Hope that gives you an insight into some potential causes of the malfunction you are experiencing.

from spfx-msgraph-peoplesearch.

MMAtHome avatar MMAtHome commented on June 7, 2024

from spfx-msgraph-peoplesearch.

YannickRe avatar YannickRe commented on June 7, 2024

They investigated this further, and all of this is due to an old Graph encoding bug that only manifested with $search. This is fixed in /beta but because there are already production apps that implement the workaround, they can't easily push the fix the v1.0.

To make $search work with the +-sign, you need to do double encoding 🤦‍♂️. Encode the + to %2B and then encode the % to %25, resulting in %252B. Example:

$search="mobilePhone:%252B1 860

Up to you to see how you want to take this knowledge into your customizations, but this is what the PG has told me and I have validated to be correct 😀

from spfx-msgraph-peoplesearch.

MMAtHome avatar MMAtHome commented on June 7, 2024

from spfx-msgraph-peoplesearch.

YannickRe avatar YannickRe commented on June 7, 2024

Yes, it'll still be startsWith and I am not sure if there is a change on the horizon soon. Sorry!
Can this issue be closed?

from spfx-msgraph-peoplesearch.

MMAtHome avatar MMAtHome commented on June 7, 2024

from spfx-msgraph-peoplesearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.