Share via


Context.AddOrExpression Method

Adds an OR aggregate context expression on the context.

Namespace:  Microsoft.SharePoint.Search.Extended.Administration.Keywords
Assembly:  Microsoft.SharePoint.Search.Extended.Administration (in Microsoft.SharePoint.Search.Extended.Administration.dll)

Syntax

'Declaration
Function AddOrExpression As AggregateContextExpression
'Usage
Dim instance As Context
Dim returnValue As AggregateContextExpression

returnValue = instance.AddOrExpression()
AggregateContextExpression AddOrExpression()

Return Value

Type: Microsoft.SharePoint.Search.Extended.Administration.Keywords.AggregateContextExpression
An AggregateContextExpression that represents the added OR-expression.

Remarks

This method should be used to get a handle to the context expression. Subsequent expression nodes should be added to the handle returned by this call and not on the context. This method will overwrite any previous context expressions on the context

Examples

This example shows how to add a simple or-expression

             // The expression to be added is OR(employeeType="FTE";location="Redmond")
             
                 SearchSettingGroup group = ....... // use existing or create new 
                 Keyword keyword = group.Keywords.AddKeyword("Headquarter");
             
                 var employeeContext = group.Contexts.AddContext("employee");
                 var employeeExpression = employeeContext.AddOrExpression();
                 employeeExpression.AddMatchExpression("employeeType", "FTE");
                 employeeExpression.AddMatchExpression("location", "Redmond");
                 keyword.AddSynonym("HQ",employeeContext); 
             

See Also

Reference

Context Interface

Context Members

Microsoft.SharePoint.Search.Extended.Administration.Keywords Namespace