id stringlengths 14 16 | text stringlengths 2 3.14k | source stringlengths 45 175 |
|---|---|---|
aa0401507e86-10 | try
{
conn.Open();
cmd.ExecuteNonQuery();
}
catch (Exception e)
{
throw e;
}
finally
{
conn.Close();
}
... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-event-receivers |
aa0401507e86-11 | private void SendEventNotification(object sender, EventArgs e)
{
try
{
List<ItemChange> events = itemChangeLookUp();
triggerEventPerSubscription(events);
}
catch (Exception ex)
{
EventLog.Log = "Application";
EventLog.Source = ServiceName... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-event-receivers |
aa0401507e86-12 | // Specify the parameter value.
int paramValue = -50;
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlCommand command = new SqlCommand(queryString, connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddWithValue("@... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-event-receivers |
aa0401507e86-13 | The next step is to build an executable file that can be added to the running services on the OData computer.
To compile and deploy the polling service
Press F5 to build your project.
Open the Command Prompt for VS2012 .
At the prompt, navigate to your project output location.
In the Bin directory, f... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-event-receivers |
aa0401507e86-14 | Notifications list: The notifications list is a simple SharePoint list that is used to record notifications received from the external system. For each new record added to the external system, a record is created in the notifications list.
Set up the SharePoint components
Now that you have the external sys... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-event-receivers |
aa0401507e86-15 | <Method Name="SubscribeCustomer" DefaultDisplayName="Customer Subscribe" IsStatic="true">
<Properties>
<Property Name="ODataEntityUrl" Type="System.String">/EntitySubscribes</Property>
<Property Name="ODataHttpMethod" Type="System.String">POST</Property>
<Pr... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-event-receivers |
aa0401507e86-16 | <DefaultValues>
<DefaultValue MethodInstanceName="SubscribeCustomer" Type="System.String">Customers</DefaultValue>
</DefaultValues>
</TypeDescriptor>
</Parameter>
<Parameter Direction="In" Name="@SelectColumns">
... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-event-receivers |
aa0401507e86-17 | </Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Type="EventSubscriber" ReturnParameterName="SubscribeReturn" ReturnTypeDescriptorPath="SubscribeReturnRootTd" Default="true" Name="SubscribeCustomer" DefaultDisplayName="Customer Subscribe">
<Acces... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-event-receivers |
aa0401507e86-18 | Open the Default.aspx page, and add the following HTML.
<input type="button" value="Subscribe" onclick="SubscribeEntity();"/>
For eventing to work, you must also enable the SharePoint list to accept external events. This is done by turning on the External Events feature.
The following is a script that will ... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-event-receivers |
aa0401507e86-19 | clientContext.load(features);
// The GUID provided here is the feature that allows external events and alerts.
var eventingFeatureId = new SP.Guid('5B10D113-2D0D-43BD-A2FD-F8BC879F5ABD');
var eventingFeature = features.add(eventingFeatureId, true, SP.FeatureDefinitionScope.farm); | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-event-receivers |
aa0401507e86-20 | clientContext.load(eventingFeature);
var onEventingFeatureActivated = function () {
alert("eventing feature activated");
};
clientContext.executeQueryAsync(Function.createDelegate(this,
onEventingFeatureActivated));
}
Just like with Subscribe , you will add a button to the page that will tur... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-event-receivers |
aa0401507e86-21 | Test the app
Now you can see the app in action.
Browse around the app to see the different lists that represent the data in the external system.
Click the Customers list.
Add a new customer.
View the new list item you just created.
Go to the notifications list to see that the external system... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-event-receivers |
9f1b33968e52-0 | Learn how to create an external list programmatically and bind it to an OData-based external content type in SharePoint.
Although a power user or SharePoint administrator will likely create an external list using SharePoint Designer 2013, a developer will be interested in the ability to create external lists using the ... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-an-external-list-using-an-odata-data-source-in-sharepoint |
9f1b33968e52-1 | Create a new external list
The following procedures will show you how to create a new external list, bind it to OData-based external content type, and publish to SharePoint using Visual Studio 2012.
Note
The first step assumes that you have successfully created an external content type, as described in Ho... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-an-external-list-using-an-odata-data-source-in-sharepoint |
9f1b33968e52-2 | See also
Business Connectivity Services in SharePoint
Using OData sources with Business Connectivity Services in SharePoint
How to: Create an external content type from an OData source in SharePoint
How to: Create a basic autohosted app for SharePoint
Using OData sources with Business Connectivi... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-an-external-list-using-an-odata-data-source-in-sharepoint |
ca152d803896-0 | Learn how to create an Internet-addressable WCF service that uses OData to send notifications to SharePoint when the underlying data changes. These notifications are used to trigger events that are attached to external lists.
This article describes how to create an ASP.NET Windows Communication Foundation (WCF) Data ... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-an-odata-data-service-for-use-as-a-bcs-external-system |
ca152d803896-1 | Using OData sources with Business Connectivity Services in SharePoint
Provides information to help you start creating external content types based on OData sources and using that data in SharePoint or Office 2013 components.
How to: Create an external content type from an OData source in SharePoint
Lear... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-an-odata-data-service-for-use-as-a-bcs-external-system |
ca152d803896-2 | The following steps will
How to create the WCF OData service
Creating a Windows Communication Foundation (WCF) service that can be accessed through the OData protocol is relatively straightforward. Visual Studio 2012 provides several tools for automatically discovering and modeling the data from various data so... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-an-odata-data-service-for-use-as-a-bcs-external-system |
ca152d803896-3 | Connect the data model to the database by doing one of the following steps, and then choose Next .
If you do not have a database connection already configured, choose New Connection , and create a new connection.
If you have a database connection already configured to connect to the Northwind database, ch... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-an-odata-data-service-for-use-as-a-bcs-external-system |
ca152d803896-4 | To enable access to data service resources
In the code for the data service, replace the placeholder code in the InitializeService function with the following.
config.SetEntitySetAccessRule("*", EntitySetRights.All);
config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
This enables author... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-an-odata-data-service-for-use-as-a-bcs-external-system |
ca152d803896-5 | XmlDocument subscriptionStore = new XmlDocument();
subscriptionStore.Load(subscriptionStorePath);
// Add a new subscription element.
XmlNode newSubNode = subscriptionStore.CreateElement("Subscription");
// Add subscription ID element to the subscription element.
XmlNode subscriptionIdStart = subs... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-an-odata-data-service-for-use-as-a-bcs-external-system |
ca152d803896-6 | subscriptionStore.Save(subscriptionStorePath);
}
Next steps
To notify SharePoint that changes have been made, you also need to create a service that queries the data source for changes, and then sends notifications to all those subscribed to notifications.
See also
Business Connectivity Services in ... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-an-odata-data-service-for-use-as-a-bcs-external-system |
ed1a63b3a9ae-0 | Learn how to use Visual Studio 2012 to discover a published OData source and create a reusable external content type for use in Business Connectivity Services (BCS) in SharePoint.
Prerequisites for creating OData-based external content types
To create an external content type from an Open Data protocol (OData) ... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-an-external-content-type-from-an-odata-source-in-sharepoint |
ed1a63b3a9ae-1 | To create a new SharePoint Add-in
In Visual Studio 2012, create a new App for SharePoint project, which is located under the SharePoint template node.
Name your project, and choose OK .
To specify the SharePoint settings, enter a name for your app, and the URL of the SharePoint server you will be debug... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-an-external-content-type-from-an-odata-source-in-sharepoint |
ed1a63b3a9ae-2 | To view the structure of the entities
Notice that Visual Studio created a new folder named External Content Types. Inside that folder, you will find a subfolder with the name of your new data source. If you further expand this, you will see an item that represents the entity you selected. To view a graphical list o... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-an-external-content-type-from-an-odata-source-in-sharepoint |
ed1a63b3a9ae-3 | {
fs.Write(streamData, 0, bytesRead);
}
} while (bytesRead > 0);
}
}
isf.Dispose();
this.Log.Comment("ExecuteStreamAccessorMethod Exit" );
}
Next steps
After you have built an ext... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-an-external-content-type-from-an-odata-source-in-sharepoint |
f72fb35bbdd2-0 | Learn how to access external data from SharePoint by using Representational State Transfer (REST) URLs for Business Connectivity Services (BCS).
This article shows how to set up an external list that retrieves data from an Open Data protocol (OData) source.
Prerequisites for accessing external data using REST
To ac... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-access-external-data-with-rest-in-sharepoint |
f72fb35bbdd2-1 | Create an SharePoint Add-in to access external data using REST
The following procedures guide you through setting up an SharePoint Add-in and configuring a webpage to make requests using REST functions to retrieve data from an external data source.
To create an SharePoint Add-in
Open Visual Studio 2012 or later... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-access-external-data-with-rest-in-sharepoint |
f72fb35bbdd2-2 | The next objective is to modify the default.aspx page that was created when you created your app. You will add a container to hold the results of the query that is executed with the page loads. By executing the scripts on the page load event, you ensure that the script is executed every time the page is browsed, and th... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-access-external-data-with-rest-in-sharepoint |
f72fb35bbdd2-3 | // Namespace
window.AppLevelECT = window.AppLevelECT || {};
// Constructor
AppLevelECT.Grid = function (hostElement, surlWeb) {
this.hostElement = hostElement;
if (surlWeb.length > 0 && surlWeb.substring(surlWeb.length - 1, surlWeb.length) != "/")
surlWeb += "/";
this.surlWeb ... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-access-external-data-with-rest-in-sharepoint |
f72fb35bbdd2-4 | ExecuteOrDelayUntilScriptLoaded(getCustomers, "sp.js");
});
function getCustomers() {
var grid = new AppLevelECT.Grid($("#displayDiv"), _spPageContextInfo.webServerRelativeUrl);
grid.init();
}
Press F5 to deploy the app to SharePoint. Browse to the Default.aspx page in the app, and a list of customers appea... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-access-external-data-with-rest-in-sharepoint |
31a6daed0f59-0 | Learn how to create an OData-based external content type using Visual Studio 2012 auto-generation tools and import it into the Business Connectivity Services (BCS) metadata store so that it can be used across an entire tenant workspace.
BDC models are complex XML definitions of an external data source. They are used wh... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-convert-an-add-in-scoped-external-content-type-to-tenant-scoped |
31a6daed0f59-1 | On the Set OData Source page, enter the URL of the OData service that you want to connect to. The URL should look something like this: http://services.odata.org/Northwind/Northwind.svc/ .
Specify a name for your OData source.
Note
For this example, you will use the Northwind service that is available from th... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-convert-an-add-in-scoped-external-content-type-to-tenant-scoped |
31a6daed0f59-2 | Choose Business Data Connectivity Service .
Choose the Import link on the server ribbon.
Choose the Browse button to specify the location where you extracted the .bdcm file.
Keep the default settings, and then choose Import .
See also
External content types in SharePoint
How to: Crea... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-convert-an-add-in-scoped-external-content-type-to-tenant-scoped |
97d60b895b26-0 | Learn how to create external content types that can be installed, secured, and used in an SharePoint Add-in.
Prerequisites for developing add-in-scoped external content types
To get started developing add-in-scoped external content types, you need the following:
SharePoint
Visual Studio 2012
Office ... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-an-add-in-scoped-external-content-type-in-sharepoint |
97d60b895b26-1 | On the Set OData Source page, enter the URL of the OData service that you want to connect to. The URL should look something like this: http://services.odata.org/Northwind/Northwind.svc/ .
Specify a name for your OData source.
Note
For this example, you will use the Northwind service that is available from th... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-an-add-in-scoped-external-content-type-in-sharepoint |
8a344cd0eb54-0 | An association is a way to create a relationship between external data entities. You create an association between two external content types so that you can join the data together over foreign keys. For example, while viewing a customer profile, you might want to see the latest orders placed by that customer and the i... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/create-associations-in-sharepoint |
6eb5f58f7330-0 | Learn how to create an external content type for SQL Server in SharePoint.
Creating an external content type is a pivotal task when you are working with external data. An external content type contains important information about connections, access, methods of operation, columns, filters, and other metadata that is ... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-content-types-for-sql-server-in-sharepoint |
6eb5f58f7330-1 | Be sure Office 2013 is ready to use To synchronize external data with Office 2013 products, you must use Windows 7 or a later version, and make sure that the Office installation option for Business Connectivity Services (BCS) is enabled (this is the default). This option installs the Business Connectivity Services Cli... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-content-types-for-sql-server-in-sharepoint |
6eb5f58f7330-2 | Generic List Select this option for any type of list.
Appointment, Contact, Task, or Post Select this option if you are creating a list that behaves like an Outlook Contact, Task, Appointment, or Post item. The Office item type that you select here determines the Outlook behavior that you want to attach to the exte... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-content-types-for-sql-server-in-sharepoint |
6eb5f58f7330-3 | In the Secure Store Application ID box, enter the target application ID name created in the Secure Store Service.
Click OK .
SharePoint Designer 2013 validates and tests the connection information. If you see messages, you must resolve them before you continue.
Select a table, view, or routine
In the... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-content-types-for-sql-server-in-sharepoint |
6eb5f58f7330-4 | Add columns
To specify the columns that you want to display from the table or view, click Next .
In the Parameters Configuration dialog box, by default all columns (known as Data Source Elements ) are selected. To remove unnecessary columns, clear the corresponding check boxes.
Note
Unlike a native Sh... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-content-types-for-sql-server-in-sharepoint |
6eb5f58f7330-5 | For the each field, do the following:
Click and highlight the field.
Under Properties , next to Office property , click the down arrow. and then select the appropriate matching field.
Note
You do not need to map all the corresponding fields. However, the fields shown in the following table must be mappe... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-content-types-for-sql-server-in-sharepoint |
6eb5f58f7330-6 | For each field that you want displayed in the external content item picker, click and highlight the field, and then under Properties , click the Show in Picker check box.
Click Next .
Note
All filters that you define are displayed in the external item picker control. Although you cannot remove specific fi... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-content-types-for-sql-server-in-sharepoint |
6eb5f58f7330-7 | A good strategy to consider is to create a set of external list views based on specific Data Source Filters that make sure that larger amounts of data are filtered first in the external data source, and then users can further filter and refine the results by using SharePoint filters.
You can create several different ... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-content-types-for-sql-server-in-sharepoint |
6eb5f58f7330-8 | Wildcards
A Wildcard filter limits what items are returned based on a user-entered string value (such as State Contains "New") and is converted to an SQL LIKE clause. Valid SQL Server wildcard characters are * (asterisk) which means match any number of characters and _ (underscore) which means match one and only one ... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-content-types-for-sql-server-in-sharepoint |
6eb5f58f7330-9 | In the Number box, enter a number.
If you want to display a list of possible matches ??n the external item picker control when there is more than one matching item, select Use to create match list in external item picker .
Under Properties , next to Default Value , enter the initial value that you want to ... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-content-types-for-sql-server-in-sharepoint |
6eb5f58f7330-10 | In the Order box, select a sort direction.
Click OK .
Under Properties , next to Default Value , enter the initial value that you want to filter by, if the user does not enter a value. If you do not enter a value, the external list does not display any items.
If you want to display but not modify a field, cl... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-content-types-for-sql-server-in-sharepoint |
6eb5f58f7330-11 | Complete the external content type
On the Quick Access Toolbar, click Save . This stores the external content type definition in the Business Data Connectivity metadata store.
Note
To provide better performance, Business Data Connectivity caches all the objects in the metadata store and updates changes by us... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-external-content-types-for-sql-server-in-sharepoint |
b6b4a5b969a0-0 | Learn about setting up a development environment for developing SharePoint solutions and SharePoint Add-ins using Business Connectivity Services (BCS).
You can create SharePoint solutions and SharePoint Add-ins by using BCS on a client computer or on a server computer, depending on the type of solution you are building... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/setting-up-a-development-environment-for-bcs-in-sharepoint |
b6b4a5b969a0-1 | See also
Set up an on-premises development environment for SharePoint Add-ins
Get started with Business Connectivity Services in SharePoint
Business Connectivity Services in SharePoint
SharePoint development overview | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/setting-up-a-development-environment-for-bcs-in-sharepoint |
165890f12a65-0 | Learn about changes and new features in Business Connectivity Services (BCS) for SharePoint, including enhanced support for REST, OData, external events, and app-scoped external content types.
Business Connectivity Services (BCS) was introduced in SharePoint 2010 as an improvement to the Business Data Catalog created f... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/what-s-new-in-business-connectivity-services-in-sharepoint |
903ccf2a841f-0 | Learn how to use SharePoint query refinement features programmatically when you are working with search queries and results.
You can use query refinement features to provide end users with refinement options that are relevant for their queries. These features let the end user drill down into search results by using r... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/query-refinement-in-sharepoint |
903ccf2a841f-1 | <refiner>[,<refiner>]*
Each refiner has the following format:
<refiner-name>[(parameter=value[,parameter=value]*)]?
Where:
<refiner-name> is the name of the managed property associated with the refiner. This managed property must be set to Refinable or Sortable in the search schema.
The optional li... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/query-refinement-in-sharepoint |
903ccf2a841f-2 | discretize
Specifies custom intervals (refinement bins) for numeric refiners. Syntax discretize=manual/<threshold>/<threshold>[/<threshold>]* Example write(discretize=manual/2013-01-01/2013-08-22/2013-09-15/2013-09-21/2013-09-22) The <threshold> attribute specifies the threshold for each refinement bin. ... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/query-refinement-in-sharepoint |
903ccf2a841f-3 | sort
Defines how to sort the bins within a string refiner. Syntax sort=<property>/<direction> The attributes perform the following: <property> - Specifies the sorting algorithm. These lowercase values are valid: frequency - Orders by occurrence within the bins. name - Orders by label name. number - Tre... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/query-refinement-in-sharepoint |
903ccf2a841f-4 | filter
Defines how bins within a refiner of type String are filtered before they are returned to the client. Syntax filter=<bins>/<freq>/<prefix>[<levels>] The attributes perform the following: <bins> - Specifies the maximum number of returned bins. After sorting the bins within the refiner, use this at... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/query-refinement-in-sharepoint |
903ccf2a841f-5 | cutoff
Limits the data that must be transferred and processed for deep string refiners. You can configure the refiners to return only the most relevant values (bins). Note : This cutoff filtering is performed within each index partition. This differs from the filter parameter, which performs result-side filteri... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/query-refinement-in-sharepoint |
903ccf2a841f-6 | Example: Adding refiners
The following CSOM example shows how to programmatically request three refiners: FileType , Write , and Companies . Write represents the last modified date for the item, and uses the advanced syntax to return fixed-size date/time bins.
using (var context = new ClientContext("http://<se... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/query-refinement-in-sharepoint |
903ccf2a841f-7 | var executor = new SearchExecutor(context);
var results = executor.ExecuteQuery(query);
context.ExecuteQuery(); | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/query-refinement-in-sharepoint |
903ccf2a841f-8 | ResultTable relevantResultsTable = results.Value[0];
ResultTable refinerResultsTable = results.Value[1];
Console.WriteLine(refinerResultsTable.RowCount + " refinement options:");
foreach (var refinementOption in refinerResultsTable.ResultRows)
{
Console.WriteLine("RefinerName: '{0}' RefinementNa... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/query-refinement-in-sharepoint |
903ccf2a841f-9 | RefinementToken
A string that represents the refinement bin to use with RefinerName when you perform a refined query.
RefinementCount
The result count for this refinement bin. This data represents the number of items (including duplicates) in the search result with a value for the given managed property tha... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/query-refinement-in-sharepoint |
903ccf2a841f-10 | 37
Creating a refined query
A search result presents refinement options in the form of string values or value ranges. Each string value or numeric value range is called a refinement bin, and each refinement bin has an associated RefinementToken value. A refinement option is associated with a managed propert... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/query-refinement-in-sharepoint |
903ccf2a841f-11 | query.RefinementFilters.Add("FileType:\\"????68746d6c\\"");
var executor = new SearchExecutor(context);
var results = executor.ExecuteQuery(query);
context.ExecuteQuery();
ResultTable relevantResultsTable = results.Value[0];
var resultCount = 1;
foreach (var relevantResult in relevantResultsTa... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/query-refinement-in-sharepoint |
903ccf2a841f-12 | // The query has been run and we can now look at the refinement data, to view the
// refinement options
ResultTable relevantResultsTable = results.Value[0];
ResultTable refinerResultsTable = results.Value[1];
Console.WriteLine("Got back {0} refinement options in the result:",
refinerResultsTable... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/query-refinement-in-sharepoint |
903ccf2a841f-13 | if (refinementOptionArray.Length > 0)
{
var firstRefinementOption = refinementOptionArray[6];
// Construct the refinement filter by concatenation
var refinementFilter = firstRefinementOption["RefinerName"] + ":" +
firstRefinementOption["RefinementToken"];
var refinedQuery... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/query-refinement-in-sharepoint |
53c2d1dd775c-0 | Get code examples that show you how to export and import customized search configuration settings. These settings include all customized query rules, result sources, result types, ranking models, and site search settings. SharePoint exposes this functionality through the Microsoft.Office.Server.Search.Portability na... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/exporting-and-importing-search-configuration-settings-in-sharepoint |
53c2d1dd775c-1 | private static void Import(string fileName)
{
SPSite site = new SPSite("http://yoursite/sites/publishing1");
SearchConfigurationPortability conf = new SearchConfigurationPortability(site);
SearchObjectOwner owner = new SearchObjectOwner(SearchObjectLevel.SPWeb, site.OpenWeb());
conf.ImportSearchConfigur... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/exporting-and-importing-search-configuration-settings-in-sharepoint |
53c2d1dd775c-2 | See also
Search in SharePoint
Export and import customized search configuration settings in SharePoint | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/exporting-and-importing-search-configuration-settings-in-sharepoint |
47358d437663-0 | This how-to guides you through the steps to implement—create, deploy, and register—a custom security trimmer for Search in SharePoint by using Microsoft Visual Studio 2010.
Search in SharePoint performs query-time security trimming of search results. However, there may be scenarios in which you want to perform custom... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-use-a-custom-security-trimmer-for-sharepoint-server-search-results |
47358d437663-1 | To create the project for a custom security trimmer
Open Visual Studio and choose File , New , Project .
In Project types , under C# , choose SharePoint .
Under Templates , choose Empty SharePoint Project . In the Name field, type CustomSecurityTrimmerSample , and then choose the OK button.
In th... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-use-a-custom-security-trimmer-for-sharepoint-server-search-results |
47358d437663-2 | On the Project menu, choose Add New Item .
Under Visual C# Items in Installed Templates , choose Code , and then choose Class .
Type CustomSecurityPreTrimmer.cs , and then choose Add .
Writing the custom security pre-trimmer code
Your custom security trimmer must implement the ISecurityTrimmerPre ... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-use-a-custom-security-trimmer-for-sharepoint-server-search-results |
47358d437663-3 | }
For the first part of the AddAccess method implementation, we find out who the user is by looking at the passedUserIdentity .
if (passedUserIdentity == null)
{
throw new ArgumentException("AddAccess method is called with invalid user identity
parameter", "passedUserIdentity");
} | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-use-a-custom-security-trimmer-for-sharepoint-server-search-results |
47358d437663-4 | String strUser = null;
var claimsIdentity = (IClaimsIdentity)passedUserIdentity;
if (claimsIdentity != null)
{
foreach (var claim in claimsIdentity.Claims)
{
if (claim == null)
{
continue;
}
// strUser is "domain\\\\user" format when web app is in Cl... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-use-a-custom-security-trimmer-for-sharepoint-server-search-results |
47358d437663-5 | // strUser2 is "S-1-5-21-2127521184-1604012920-1887927527-66602" when web app is
in Legacy Windows Mode
// In this case we need to convert it into NT user format.
if (SPClaimTypes.Equals(claim.ClaimType, ClaimTypes.PrimarySid))
{
strUser = claim.Value;
Secu... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-use-a-custom-security-trimmer-for-sharepoint-server-search-results |
47358d437663-6 | Writing the custom security post-trimmer code
Your custom security trimmer must implement the ISecurityTrimmerPost interface. The code example in this section is a basic implementation of this interface.
To modify the default code in CustomSecurityPostTrimmer
Add the following using directives at the beginn... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-use-a-custom-security-trimmer-for-sharepoint-server-search-results |
47358d437663-7 | }
The basic version of this sample does not include any code in the Initialize method.
Add the following code for the CheckAccess() method declaration.
public BitArray CheckAccess(IList<string> documentCrawlUrls, IList<string> documentAcls, IDictionary<string, object> sessionProperties, IIdentity passedUser... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-use-a-custom-security-trimmer-for-sharepoint-server-search-results |
47358d437663-8 | {
var userGroups = GetGroupList(claimsIdentity.Claims);
var numberDocs = documentCrawlUrls.Count;
for (var i = 0; i < numberDocs; ++i)
{
if (!string.IsNullOrEmpty(documentAcls[i]))
{
urlStatusArray[i] = VerifyAccess(documentAcls[i], userGroups);
}
}
}
If the user has access ... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-use-a-custom-security-trimmer-for-sharepoint-server-search-results |
47358d437663-9 | Open the shortcut menu for the file, and then choose Properties.
On the General tab in the Properties dialog box, select the token and copy it.
Open the SharePoint Management Shell. For information about using this tool, see Administering Service Applications Using the SharePoint 2010 Management Shell
... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-use-a-custom-security-trimmer-for-sharepoint-server-search-results |
47358d437663-10 | See also
Custom security trimming for Search in SharePoint
Microsoft.Office.Server.Search.Query.ISecurityTrimmerPre
Microsoft.Office.Server.Search.Query.ISecurityTrimmerPost
Microsoft.Office.Server.Search.Query.PluggableAccessCheckException | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-use-a-custom-security-trimmer-for-sharepoint-server-search-results |
b514b22ba8bd-0 | APPLIES TO: 2013 2016 2019 SharePoint Online in Microsoft 365
Improve search relevance by customizing ranking models to calculate rank scores (relevance rank) accurately using rank features in SharePoint.
You can sort search results in SharePoint in four ways, one of which is by rank score. When you sor... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-1 | Important
If you install the SharePoint cumulative update of August 2013, we recommend using the Search Ranking Model with Two Linear Stages as the base model for your custom ranking model. The Search Ranking Model with Two Linear Stages is a copy of the Default Search Model with a linear second stage instead o... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-2 | $defaultRankingModel.RankingModelXML > filename.xml
If you install the SharePoint cumulative update of August 2013, you can use the following procedure to retrieve the search ranking model with two linear stages to use as a template for your custom ranking model.
To retrieve the search ranking model with two linea... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-3 | $rm.RankingModelXML > myrm.xml
Edit the myrm.xml file in an XML editor. You must use new GUID values for the id attributes in RankModel2Stage element and all RankingModel2NN elements. To get a new GUID value you can for example use the following Windows PowerShell command: [guid]::NewGuid()
Create a ... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-4 | Conceptually, the overall format of the rank detail looks like the following example.
<rank_log version='15.0.0000.1000' id='[internal guid of ranking model used for calculation]' >
<query tree='[representation of user query used for ranking]'/>
<stage type='linear'>
[Details of rank calculation of th... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-5 | $searchexecutor = new-Object Microsoft.Office.Server.Search.Query.SearchExecutor
$resultTables = $searchexecutor.ExecuteQuery($request)
$resultTables[([Microsoft.Office.Server.Search.Query.ResultType]::RelevantResults)].Table
Understanding the rank score calculation via the ExplainRank page
SharePoint provides the... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-6 | The BM25 rank feature calculates the relevance rank score using the following formula.
Where:
D is a document, represented as a list of textual fields such as the title or body.
Q is the user query, represented as a list of query terms, t .
S defines the list of fields that contribute to relevance ranki... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-7 | In addition, query terms that are under scope, for example, title:apple AND body:orange , are excluded from relevance rank calculations.
Example BM25 rank feature definition
<BM25Main name="ContentRank" k1="1">
<Layer1Weights>
<Weight>0.26236235707678</Weight>
</Layer1Weights>
<Properties>
... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-8 | Example rank detail for BM25 rank feature
<bm25 name='ContentRank'>
<schema pid_mapping='[1:content::7:%default] [2:content::1:%default] [3:content::5:%default] [56:content::2:%default] [100:content::3:link] [10:content::6:link] [264:content::14:link] ' pids_not_mapped=''/>
<query_term term='WORDS(content:integration... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-9 | <query_term term='WORDS(content:effort, content:efforts, content:efforts)'>
<index name='content' N='10035' n='9'
avdl='1 2.98018 2.00427 1 1 2.39394 1 637.308 1 1 1 1 1 1 1 1 '>
<group id='%default'/>
<group id='link'/>
</index>
<rank score='0' score_acc='2.37967' term_weight='7.... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-10 | <query_term term='PHRASE(content:fastserver, content:plugin)'>
<index name='content' N='10035' n='3'
avdl='1 2.98018 2.00427 1 1 2.39394 1 637.308 1 1 1 1 1 1 1 1 '>
<group id='%default'
ext_doc_id='55' int_doc_id='16' precalc='0' tf_prime='0.0399696' weight='1'
tf='... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-11 | </bm25>
Weight groups
In a custom ranking model, you can have two or more managed properties that are mapped to the same weight group in the search schema. In such cases, content of these managed properties is combined in the full-text index and can't be ranked separately in BM25 calculation. This effect is the sa... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-12 | </Static>
Example rank detail for a static rank feature
<static_feature name='clickdistance' property_name='clickdistance'
used_default='1' raw_value='5' raw_value_transformed='5'
transformed='0.420003' normalized='0.420003'
hidden_nodes_adds='0.258859 '/>
Bucketed static
The bucketed static rank ... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-13 | <Bucket name="Html" value="0">
<HiddenNodesAdds>
<Add>0.464062832328107</Add>
</HiddenNodesAdds>
</Bucket>
<Bucket name="Doc" value="1">
<HiddenNodesAdds>
<Add>0.551558196047853</Add>
</HiddenNodesAdds>
</Bucket>
<Bucket name="Ppt" value="2">
... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-14 | <Bucket name="Image" value="8">
<HiddenNodesAdds>
<Add>0.106988843357609</Add>
</HiddenNodesAdds>
</Bucket>
</BucketedStatic>
Example bucketed static rank feature definition for document language
The content processing component detects the language for each document automatically b... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-15 | Attributes
Description
isExact=0
In this mode, the proximity algorithm attempts to find the minimal span (distance) of the subset of query terms in a document. The proximity algorithm considers fragments that contain query terms in the same orders as they appear in the user query. If no fragment exis... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-16 | proximity="perfect"
This mode is similar to complete mode, but is applied to short fields, such as title . The proximity rank feature only boosts documents where the whole user query text matches an exact title within a specific managed property. If the title contains additional terms outside of the user qu... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-17 | <Weight>0.0286196612755843</Weight>
<Weight>0.11775902923563</Weight>
<Weight>0.0885860088190342</Weight>
<Weight>0.102859503886488</Weight>
</Layer1Weights>
</MinSpan>
You must map the managed properties used in proximity rank features to the default full-text index in search schema.
E... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-18 | <Layer1Weights>
<Weight>0.715419978898093</Weight>
</Layer1Weights>
</Dynamic>
Freshness
The default SharePoint ranking model doesn't boost the rank of search results based on their freshness. You can achieve this by adding a new static rank feature that combines information from the LastModif... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
b514b22ba8bd-19 | Example rank detail for freshness rank feature using an old document (approximately 580 days old)
<static_feature name='freshboost' property_name='LastModifiedTime' raw_value_transform='compare' used_default='0' property_value_found='1' property_value='9807115930137649186' raw_value='9.80661e+018' raw_value_transform... | https://learn.microsoft.com/en-us/sharepoint/dev/general-development/customizing-ranking-models-to-improve-relevance-in-sharepoint |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.