ટેગ આર્કાઇવ્ઝ: શોધો

એક શોધ અવકાશ તરીકે લોકો સ્પષ્ટ કરવા માટે કેવી રીતે / સામગ્રી સોર્સ મદદથી શેરપોઈન્ટ 2013 બાકીના API

I had reason to work with the SharePoint 2013 Search API via REST for the first time. I wanted to search for people, not documents. The key learning here is that you specify content sources via its GUID (or at least in this case). The following jQuery snippet shows how:

    loadExpertsAsync: કાર્ય() {

        jQuery.support.cors = સાચું;

        $.ajax({
            URL: .CreateFullApiUrl() +
                "?querytext='portals'&sourceid='b09a7990-05ea-4af9-81ef-edfab16c4e31'" +
                "&selectproperties='LinkedInProfileUrl,GoogleCirclesProfileUrl,BALargeProfilePictureUrls,BAGridPictures,WorkEmail,Skills,AboutMe,Interests,JobTitle,PastProjects,PictureURL,PreferredName,TwitterHandle,LinkedInProfileUrl,PreferredName,GoogleCirclesProfileUrl'" +
                "&rowlimit=99",
            પદ્ધતિ: "GET",
            headers: { "Accept": "application/json; odata=verbose" },
            cache: ભૂલ ખવડાવનારું,
            success: કાર્ય (પરિણામ) {

મારા કિસ્સામાં, I’m running the API against SharePoint online. To get the GUID, I followed these steps:

  1. Access the SharePoint admin center
  2. Select “search” from the left hand navigation
  3. Select “Manage Result Sources”
  4. Select “Local People Results”
  5. Look at the URL.

My URL looked something like:

https://xyzzy-admin.sharepoint.com/_layouts/15/searchadmin/EditResultSource.aspx?level=tenant&sourceid=b09a7990%2D05ea%2D4af9%2D81ef%2Dedfab16c4e31&view=1

The sourceid parameter is what worked for me.

(I understand that the sourceid may actually be a sort of permanent thing with SP, પરંતુ હું હંમેશા કોઈપણ તપાસ કરીશું 🙂 ).

</અંત>

undefinedમારા બ્લોગ પર સબ્સ્ક્રાઇબ કરો.

Twitter પર મને ખાતે અનુસરો http://www.twitter.com/pagalvin

ઉદાહરણ શેરપોઈન્ટ બાકીના કોલ્સ

Here’s a set of sample REST calls that work for me and may help you out as well. મુજબ 02/2014, બે ઉદાહરણો છે 🙂

  1. Reference a Column With Spaces In Its Name
  2. Reference a Multi-Select Column
  3. Perform a People Search via REST

 

I’ll add to this as time passes.

Here are some useful inks I’ve found as well:

Reference a Column With Spaces In Its Name

I create a custom list with a column named “Blog Author” (space between Blog and Author).

The $select to reference that column is:

image

Simply replace the space with “_x0020_”. We see the _x0020_ in many examples across the internets and REST is no different.

If you don’t do that, you’re liable to get an error message like this:

The expression “Blog Author” is not valid.

Easy enough.

Reference a Multi-Select Lookup Column

Set up:

  1. Create a custom list named Categories.
  2. Add some categories. I added categories thusly:image
  3. Create another custom list called MockBlog and add Categories as a multi-select list column (or site column if that’s how you roll).

Add some items to your Mockblog list and you’re ready.

An Ajax style call using jQuery will look something like this:

serverUrl  = "/_api/web/lists/GetByTitle('MockBlog')/આઇટમ્સ" +
             "?$select=Title,Categories/Title,Blog_x0020_Author/Title" + 
             "&$expand=Blog_x0020_Author,Categories";

We’re telling SharePoint “Give me the title for all the Categories (Categories/Title). Get the actual values for શીર્ષક દ્વારા $expanding the Categories list.” (My RESTful paraphrasing is probably pretty loose, but this how I’m interpreting it).

If you’re doing this via JavaScript and using Fiddler to look at the output, you get something like this in return:

 

image

(The above is a JSON object)

Perform a People Search via REST

I blogged about this separately. The key is to specify a sourceid parameter whose value is the GUID of the Local People content source. (Content sources used to be called scopes and it’s my-oh-my so hard not to call everything a scope for me!).

તે વિશે વધુ અહીં વાંચો: http://www.mstechblogs.com/paul/?p=10385

 

</અંત>

undefinedમારા બ્લોગ પર સબ્સ્ક્રાઇબ કરો.

Twitter પર મને ખાતે અનુસરો http://www.twitter.com/pagalvin