Unique identifier for a Sharepoint document when crawling using SiteData Webservice

Does anyone know how I can map a UniqueID property to a managed property so that I can display it in advanced search results? This property does not appear when I try to create a new managed property using the Metadata Property Mapping link in Shared Services Administration.

Using the SiteData or Lists web service, I can see the ows_UniqueId property, and using the object model I can access the SPListItem.UniqueID property, but I cannot find a way to map this to a workaround / managed property.

+3
source share
2 answers

It should already be indexed. Have you tried using objectid? This is shown as mapping to SharePoint:objectid(Text). It looks closest to what you need.

0
source

This is pretty painful and maybe not supported, but here is what you need to do to make the UniqueId property of the property being processed / mapped so that it can be included in advanced search results ...

First, you need to internally change the UniqueId field in the list (s) you want to find so that it no longer hides and can be indexed by the crawler. Here is a sample object model code:

// this is the identifier for UniqueId
Guid g = new Guid("4b7403de8d9443e89f0f137a3e298126");
// we will need these for reflection in a bit
BindingFlags bf = BindingFlags.NonPublic | BindingFlags.Instance;
using (SPSite s = new SPSite("http://SharePoint/")) {
  // grab the list that contains what you want indexed
  // and the UniqueId field from that list
  SPList l = s.RootWeb.Lists["Your Custom List/Library"];
  SPField f = l.Fields[g];
  // We need to call the private method SetFieldBoolValue
  // to allow us to change the Hidden property to false
  MethodInfo mi = f.GetType().GetMethod("SetFieldBoolValue", bf);
  mi.Invoke(f, new object[] { "CanToggleHidden", true });
  f.Hidden = false;
  f.Update();
}

( /, ), :

, , , UniqueId. , :

  • -
  • " "
  • XML , UniqueId
  • XSL , UniqueId
  • "" .
0

Source: https://habr.com/ru/post/1717828/


All Articles