Ektron v8.5: Search within Title, Content, Summary, and other property using API

  • Updated

Adding a search term to the QueryText property will search within the title, content, and summary of content. However, if you want the search term to match the title, content, summary OR another property (for example, a taxonomy category), you cannotuse QueryText, since an AND operation is performed between the QueryText and any additional properties.

To perform a query in which a term matches the title, content, summary, OR additional properties, add the following property instead of adding the term to the QueryText property:

new SearchStringProperty()

{

Property="", SearchTerm="searchword"

}

So, in the following example, the search terms are title="alpha" OR summary="alpha" OR content="alpha" OR taxonomycategory="alpha":

        requestData.QueryText = "";
        List searchGroups = new List()
        {
            new SearchPropertyGroup()
            {
                SearchProperties = new List()
                {
                    new SearchStringProperty()
                    {
                        Property="", SearchTerm="alpha"
                    },
                    new SearchStringProperty()
                    {
                        Property="taxonomycategory", SearchTerm="alpha", PropertyOperator=LogicalOperator.Or
                    }  

                   
                }
            }

        };