PRC search in built-in properties

Hi there,
I would like to write a portlet which could search in User objects and in specified properties/property of users. I mean a portal user has first name, last name, email, company etc. built-in properties and it is allowed to add more user specified properties as well. I would like to search only in email property or in company name, etc.
There is a IFilterClause object and it has a addStatement(Field, operator, value) method. It could be cool for me but I need Field objects... I can create new Field objects with PortalFields.forID(id) method, but I CANNOT create fields with id number<100... Email, company etc. properties have id number<100. Of course non built-in properties (created by an administrator for example) have id number >200, so I can search in non bulit-in properties only.
Is there any solution to create FilterClause statements for built-in properties?
thanks in advance,
Zsolt

Craig,
I am developing a portlet to search the properties of a user's profile using C#. If you could post the code to assist me with this issue I would be greatful. I currently am using the code below and have hard coded the ID for the user Address in as when I had it pulling from the web.config I was receiving the error : Property ID out of Range. The error I am receiving now is : com.plumtree.openfoundation.util.XPIllegalArgumentException
Here is my complete code:
privatevoidGetUserInfo()
IPortletRequest portletRequest = portletContext.GetRequest();
IRemoteSession session = PortalUtility.GetRemoteConnection();
IPortletUser portletUser = portletContext.GetUser();
this._ownerid = portletUser.GetUserID().ToString();
ISearchFactory searchFactory = session.GetSearchFactory();
IFilterClause filter = searchFactory.CreateAndFilterClause();
filter.AddStatement(PlumtreeField.NAME,Operator.Contains,this.txtName.Text);
IFilterClause andFilterClause = searchFactory.CreateAndFilterClause();
IPortalSearchRequest searchRequest = searchFactory.CreatePortalSearchRequest();
//add a statement for created in the last three months
DateTime dt = DateTime.Now.AddMonths(-12);
andFilterClause.AddStatement(PlumtreeField.CREATED, Operator.GreaterThan, dt);
searchRequest.SetQuery(andFilterClause);
ObjectClass[] classes = newObjectClass[1];
classes[0] = ObjectClass.User;
searchRequest.SetObjectTypesToSearch(classes);
searchRequest.SetQuery(filter);
searchRequest.SetResultsCount(0, 999);
// run the search
ISearchResponse searchResponse = searchRequest.Execute();
//iterate through the results
ISearchResultSet resultSet = searchResponse.GetResultSet();
IObjectManager objectManager = PortalUtility.GetRemoteConnection().GetObjectManager(ObjectClass.User);
IObjectQuery queryResults;
queryResults = objectManager.QueryObjects();
IObjectQueryRow queryObject = objectManager.QuerySingleObject(UserId);
IExtendedData customProperties = queryObject.GetExtendedData();
IEnumerator results = resultSet.GetResults();
while(results.MoveNext())
Response.Write("--------------------------------------------------");
Response.Write("<br>");
IPortalSearchResult result = (IPortalSearchResult) results.Current;
Person operson = newPerson();
operson.Name = result.GetFieldAsString(PortalField.NAME);
operson.ObjectID = result.GetFieldAsString(PortalField.OBJECT_ID);
Response.Write("" + operson.Name);
Response.Write("<br>" + operson.ObjectID);
// when returning properties that may be null make sure to do a null check
// with the GetFieldAsObject method before trying to use the field
if(result.GetFieldAsObject(PortalField.ForID(157)) != null)
operson.Email = result.GetFieldAsString(PortalField.ForID(157));
Response.Write("" + operson.Email);
Cheers,
Nick Simpson
(e) [email protected]

Similar Messages

  • Help: PRC Search crashes IIS

    Hello there,
    I'm posting here first in hopes to get a quick insight into a problem before I send it to support people. I'm doing a load testing of plumtree's remote search and under certain conditions it crashes our IIS entirely. Here is my setup.
    PT Portal and PTAPI sits on one box, PT Search Server sits on another box. A remote virtual application resides on the portal box in its own virtual folder under high isolation level. The application consists of one page which uses PRC search to get PT users with given text. The same search is performed under explicit context using the same user credentials every time.
    I'm using Microsoft Application Center Test to do the load testing. The goal is to test a maximum sustained number of requests per second as the number of users increase. I start with one user and end at fifty.
    Around 35 user connections the performance peaks at about 40 rps, then it declines, IIS returns loads of errors, and around 45+ connections IIS dies completely. R.I.P.
    If I introduce slight variations into my tests (changing explicit credentials with each request, changing search string with each request, running PTSpy (!!!), etc), I get wildly different results, however none with dramatic crash. The errors I receive range from "server unxpectedly closed connection", to "Unexcpected error in PTFilter", to something about "Search queue/pool exceeding 20 limit".
    Anyone knows about anything of sorts?
    Thanks,Ruslan.

    Hello there,
    I'm posting here first in hopes to get a quick insight into a problem before I send it to support people. I'm doing a load testing of plumtree's remote search and under certain conditions it crashes our IIS entirely. Here is my setup.
    PT Portal and PTAPI sits on one box, PT Search Server sits on another box. A remote virtual application resides on the portal box in its own virtual folder under high isolation level. The application consists of one page which uses PRC search to get PT users with given text. The same search is performed under explicit context using the same user credentials every time.
    I'm using Microsoft Application Center Test to do the load testing. The goal is to test a maximum sustained number of requests per second as the number of users increase. I start with one user and end at fifty.
    Around 35 user connections the performance peaks at about 40 rps, then it declines, IIS returns loads of errors, and around 45+ connections IIS dies completely. R.I.P.
    If I introduce slight variations into my tests (changing explicit credentials with each request, changing search string with each request, running PTSpy (!!!), etc), I get wildly different results, however none with dramatic crash. The errors I receive range from "server unxpectedly closed connection", to "Unexcpected error in PTFilter", to something about "Search queue/pool exceeding 20 limit".
    Anyone knows about anything of sorts?
    Thanks,Ruslan.

  • Issues with PRC search

    I'm having all kinds of fun with the PRC search API and I'm wondering if anyone else has experienced any of these issues. These two are the current thorns in my side:
    1) IPortalSearchResult.getIconURL returns an incorrect image URL. My server (tomcat) is on http://bdg-solaris2:8080/portal/server.pt and my images (apache httpd) are on http://bdg-solaris2:8888/imageserver. Here's a sample URL coming back from getIconURL:
    http://bdg-solaris2:8080/imageserver/plumtree/portal/public/img/icon_user.gif
    It has the wrong port. Why?
    2) IPortalSearchResult.getURL returns an empty string. Why? My current search is on users -- wouldn't it be appropriate to return the opener URL for the URL object or do I need to construct this myself?
    Geez.
    Chris Bucchere | bdg | [email protected] | http://www.bdg-online.com

    Hi, Chris -
    Yeah... I tell ya, I saw something like this and I kinda just bypassed it
    1) Instead of using the getIconURL I just popped the output into an adaptive tag on the way out to draw the property. I do have a snippet of PRC search code at work that used this - I'll have to check when I get into the office. When I saw this it was goofier than your example - it was getting confused and mangling the URL for me in a different way. I chalked it up to my noobness at that point and didn't have time to mess with it. I'm curius - that config setting is contained somewhere and sent to the remote tier - I'll bet it's confused somewhere on the portal or WS API tier and passing this along. If you check the WS API logs, does it show what it "thinks" the right imageserver URL is?
    2) Ditto-ish on this. I avoided the getURL altogether and just used the common opener link tag. I figured I had the object and class Ids, so... I just fed them into the tag.
    I know that doesn't answer your question pe se, but maybe it's another option?
    Thanks,
    Eric

  • Search over all translated properties

    Hello
    I just translated the new project "soa.bpmn2-modeler" in German.
    Now I want to make sure I use consistent naming for certain things and would like to search over all translations for certain suspecting terms.
    Is there a way to search online over the properties, can I download a snapshot or is there a Git repository?
    Thanks for Infos
    Flavio

    Nevermind Just found the "Developer and Nightly Builds" at the bottom of the Downloads page:
    http://build.eclipse.org/technology/babel/babel_language_packs/

  • Pdf files in search results - open the properties paga instead the file

    Hi,
    We have 2010 search results page for searching files. When the search result is a pdf - the icon shown is not pdf icon and when click the file name it opens the properties page instead the file itself. What should be set? thanks a lot
    keren tsur

    It looks like you didn't register PDF file type in your search service application.
    Go to Central Administration->Manage Service Application. Click on the name of your search service application and check file types (link in the left column)

  • How to get Search and offline Availability properties in SharePoint using powershell with CSOM

    Hi,
    I want to get the information about the SharePoint sites being crawled or not. I tried to get "Search and offline Availability in SharePoint" settings properties but I couldn't get those properties.
    I followed below thread with no luck : http://www.c-sharpcorner.com/uploadfile/anavijai/search-and-offline-availability-in-sharepoint-2010/
    I couldn't find $web.AllowAutomaticASPXPageIndexing property at site level but i can see $list.NoCrawl
    at list level.
    Can any body help me out to get those values?
    Any help would be greatly appreciated.
    Thank you.
    AA.

    Hi,
    Since AllowAutomaticASPXPageIndexing is a member in SPWeb members while not in Web members, we can not use Client Side Object Model with it. If you need to use it in client side, you need to create a web service for it.
    https://msdn.microsoft.com/EN-US/library/microsoft.sharepoint.client.web_members.aspx
    https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb_members.aspx
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Enabling site search based on more properties in BCC

    When I browse for sites under "Site Assets" in BCC, we currently have a filter that can filter by name. Is it possible to filter by other additional properties of Site that I might have added to siteRepository?
    Which is the file I should change to achieve this kind of searching?

    JokerBoy wrote:try this
    Forgot about this thread . Thanks very much!
    I'm just xsource-ing this file in my .zshrc, couldn't find any other 'load-all-scripts-in-this-directory' type folders for zsh. Hopefully that doesn't break anything

  • Query Publisher items using the PRC Search API

    Does anyone know if it is possible to query Publisher items from the PRC API? In my tests, even if I leave the filters blank and do a generic search for '*' I don't get Publisher items back. (Doing the same generic search from the portal does return Publisher items.) I'm afraid I might have to use the server search api, which I would rather not do. Anybody have experience with this one way or the other?
    Thanks
    DJ Dewey | VHA Inc. | [email protected]

     Hello Peter,
     Thank you for your question.
     We are currently looking
    into this issue and will give you an update as soon as possible.
     Thank you for your understanding
    and support.
     Best Regards,
     Zhengyu Guo
    Zhengyu Guo
    TechNet Community Support

  • Create advanced search page using crawled properties?

    When editing an advanced search web part, is it possible to use crawled properties to help filter a search?
    Or is the only option to use managed properties?
    www.SharePointed.com

    I hope these two links will be helpful for you
    http://social.technet.microsoft.com/Forums/en-US/ed2fcfe1-ebad-4398-a442-466ddfbaf0dd/advanced-search-with-managed-properties-and-crawled-property-mapping?forum=sharepointsearchlegacy
    http://searchunleashed.wordpress.com/2011/08/24/understanding-crawled-properties-managed-properties-and-full-text-index-part-1/
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer :)

  • Unable to filter people search results by managed properties

    I am in a strange situation. If I do not specify any filters, my people search works fine. However, if I filter it by a managed property, it does not return any results.
    How can I verify the search crawl is crawling these properties?
    Any pointers?

    Hi,
    According to your description, my understanding is that when you filter managed properties in People search results, then it doesn't return any results.
    Something needs to clarify. Does all the properties not return results or some specific properties ?
    If just some properties not return results, then I suggest you can check if you have set indexed for these properties and if there are valid data in the properties.
    If all the properties can't be filtered, I suggest you can check if there are something wrong in the ULS logs and check if you have set up People search correctly.
    More information:
    How to: Set up People Search in SharePoint 2013
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to get SharePoint Search and offline Availability properties using powershell with CSOM

    Hi,
    I want to get the information about the SharePoint sites being crawled or not. I tried to get "Search
    and offline Availability in SharePoint" settings properties but I couldn't get those properties.
    I
    followed below thread with no luck : http://www.c-sharpcorner.com/uploadfile/anavijai/search-and-offline-availability-in-sharepoint-2010/
    I couldn't find $web.AllowAutomaticASPXPageIndexing property at site level
    but i can see $list.NoCrawl at list level.
    Can any body help me out to get those values?
    Any help would be greatly appreciated.
    Thank you.
    AA.

    Hi,
    Since AllowAutomaticASPXPageIndexing is a member in SPWeb members while not in Web members, we can not use Client Side Object Model with it. If you need to use it in client side, you need to create a web service for it.
    https://msdn.microsoft.com/EN-US/library/microsoft.sharepoint.client.web_members.aspx
    https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb_members.aspx
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • CS5 can't search in built in help app

    When I try to search in Adobe Help app it always says try again unexpected error occured.

    Did you ever get this error resolved?
    We're seeing it now with an update of Community help for LR 3.3 which updated it from 3.3.0.800 to 3.3.5.200 (also updated Adobe Air to 2.5.1).
    Can't search for anything within LR help without receiving the "unexpected error occurred" message.
    This is using Vista 32-bit and 64-bit. So it appears it's a cross-platform problem.
    Hope you were able to get it resolved. If so, please post the resolution.
    - Bonnie

  • Prc search results show different property

    We are wirting a custom search based on the simple search example and want to show the description property in the results.

    I have the same problem with AIFF's too...
    It's a big problem for me as I'm currently doing some sound design.
    I need to see the file name in the finder, not the title/track name.

  • How to check for space in manual trigger Search Mask(True/False) Propertie?

    I would like to trigger an section called section1 coded within the from frm1, when at least one record of a transaction has a value of FRM at offset 1 and spaces in position 358?
    I am trying to specify as below:
    1,FRM,358()
    is the above syntax correct?
    Even though, ' ' appears in extract file for record at offset 358 and with FRM in position 1, the section1 is not triggrered. I have verified in the NA file?
    Please note that FRM can be a repeating record.
    Thanks,
    Bala

    Hi Bala,
    The correct trigger would be:
    "1,FRM,358, "
    Please note the space at the end of the trigger.
    Gaétan

  • New Masthead with a built-in search :: questions

    I have created a new Page (2-column, wide and narrow) and in that Page I added my headerm iView and my search iView - header in the wide column, search in the narrow.
    In my portal Framework, I made the existing header and the toolarea with search not visible. Effectively making the default masthead and toolarea go away.
    I then added my new Page (new header iview with search iview built in) to the framework and positioned it in the masthead spot of the framework using the layout view.
    My problem is that there is a visible border/padding/gaps between the header iView and the search iView. If my masthead area were all white (background color) this would not be an issue, but I am doing a similar gradient fade (like here at SDN) so these gaps do not look good.
    I have set the "Show Padding Inside" property in all iView and the page to "NO" - this did not get rid of the gaps.
    <a href="http://www.midnighttoast.com/images/mastheadWithSearch.gif">Example</a>
    I believe the issue lies in the Page - that it has these gaps in it and they cannot be turned off through properties or other standard interface options. Can anyone help me get rid of the gaps in my masthead?
    Thanks!

    Hi Tony,
       I don't have an exact answer for you but I may be able to point you to something that would help.  If you are on NetWeaver 04 SPS14 or higher, there is new layout capabilities using tag libraries.  Here is the link to the documentation.  http://help.sap.com/saphelp_nw04/helpdata/en/42/ea3a29b28e1bcae10000000a11466f/frameset.htm
    I have not used them but I have seen the results from people who have.  They tell me you can change just about anything.  Maybe someone with some experience will post and give you more info.
    Good Luck.
    John

Maybe you are looking for