Ontolica for SharePoint Public API

OntolicaQuery.Expression Property

Gets or sets the search expression.

[Visual Basic]
Public Property Expression As String
[C#]
public string Expression {get; set;}

Property Value

A string that represents the search expression.

Remarks

The format of the search expression is identical to the format users can type in the keyword input field in the built-in search dialogs of Ontolica.

It is therefore possible to specify a search expression containing single keywords, phrases, property filters, Boolean operators and parentheses. Please note that property filters requires the property to be defined in the current search configuration in the OntolicaSearch.xml file. See the examples below to get more familiar with the format.

Exceptions

Exception TypeCondition
FormatException The specified search expression contains errors.

Example

The following table shows some examples of different search expressions that can be passed to Ontolica.

ExpressionDescription
SharePointA search for documents containing the keyword SharePoint
"SharePoint Portal Server"A search for documents containing the phrase SharePoint Portal Server
Author:DoeA search for documents authored by a person whose name contains the word Doe.
Author="John Doe"A search for documents authored by a person named John Doe.
Size>10KBA search for documents larger than 10 KiloBytes.
SharePoint Ontolica A search for documents containing the keyword SharePoint AND the keyword Ontolica
SharePoint AND OntolicaSame as above because the AND operator is implicit when not specified.
SharePoint OR Ontolica A search for documents containing the keyword SharePoint OR the keyword Ontolica
(SharePoint OR Ontolica) AND Author="John Doe" A search for documents containing the keywords SharePoint OR the keyword Ontolica AND is authored by John Doe

See Also

OntolicaQuery Class | NavigoSystems.Ontolica.SharePoint.Custom Namespace