Hi i use below code for Getting people Search. Using below code I am able to search but getting only user name and User my site url.

I want all user profile Property.How I get all user Property using this code.Any change in Query?

   var quickSearchConfig = {
delay: 500,             // time to wait before executing the query (in ms)
minCharacters: 3,       // minimum nr of characters to enter before search
scope: "People",     // search scope to use
numberOfResults: 15,    // number of results to show
resultsAnimation: 200,  // animation time (in ms) of the search results
resultAnimation: 0      // animation time (in ms) of individual result (when selected)
};    

function search(query) {
   quickSearchSelectedDivIndex = -1;
   var queryXML = 
       "<QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'> \
       <Query domain='QDomain'> \
        <SupportedFormats><Format>urn:Microsoft.Search.Response.Document.Document</Format></SupportedFormats> \
        <Context> \
         <QueryText language='en-US' type='STRING' >SCOPE:\"" + quickSearchConfig.scope + "\"" + query + "</QueryText> \
        </Context> \
       <SortByProperties><SortByProperty name='Rank' direction='Descending' order='1'/></SortByProperties> \
        <Range><StartAt>1</StartAt><Count>" + quickSearchConfig.numberOfResults + "</Count></Range> \
        <EnableStemming>false</EnableStemming> \
        <TrimDuplicates>true</TrimDuplicates> \
        <IgnoreAllNoiseQuery>true</IgnoreAllNoiseQuery> \
        <ImplicitAndBehavior>true</ImplicitAndBehavior> \
        <IncludeRelevanceResults>true</IncludeRelevanceResults> \
        <IncludeSpecialTermResults>true</IncludeSpecialTermResults> \
        <IncludeHighConfidenceResults>true</IncludeHighConfidenceResults> \
       </Query></QueryPacket>";

   var soapEnv =
       "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> \
         <soap:Body> \
           <Query xmlns='urn:Microsoft.Search'> \
             <queryXml>" + escapeHTML(queryXML) + "</queryXml> \
           </Query> \
         </soap:Body> \
       </soap:Envelope>";
   $.ajax({
       url: "/_vti_bin/search.asmx",
       type: "POST",
       dataType: "xml",
       data: soapEnv,
       complete: processResult,
       contentType: "text/xml; charset=\"utf-8\""
   });       
   function processResult(xData, status) {
       $(xData.responseXML).find("QueryResult").each(function() {               
           var x = $("<xml>" + $(this).text() + "</xml>");
           x.find("Document").each(function() {
               var title = $("Title", $(this)).text();
               var url = $("Action>LinkUrl", $(this)).text();
               var description = $("Description", $(this)).text()
               alert($(this).text());

           });              

       });      

       );                                
   }            
   }

   function escapeHTML (str) {
  return str.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
   }    
  search('administrator'); 
link|improve this question

50% accept rate
feedback

2 Answers

You can call the User Profile Service with each account returned by search. Each Web Service focuses on different tasks and subsets of data and many times you must combine them to build applications.

Also consider using my SPServices jQuery library to make things easier. http://SPServices.codeplex.com

link|improve this answer
feedback

xData.responseXML is the response from the webservice you recieve. from the below code

 var title = $("Title", $(this)).text();   
 var url = $("Action>LinkUrl", $(this)).text();          
 var description = $("Description", $(this)).text() 

here you are getting only title property ,LINKURL and Description Check other properties and include them in code

Thanks

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.