How to use PropertyCriteria on complex property?

Vote:
 

Hi. I'm new to EPiSERVER. Currently trying to search for a page with a specific property set to a specific value.

I need the property CatalogEntryPoint (a ContentReference) to equal something. Here is the criterea:

        PropertyCriteria secCriteria = new PropertyCriteria();

        secCriteria.Condition = CompareCondition.Equal;
        secCriteria.Name = "CatalogEntryPoint.ID";
        secCriteria.Type = PropertyDataType.Number;
        secCriteria.Value = currentContent.ContentLink.ID.ToString();
        secCriteria.Required = true;

And here is an excerpt from the search index:

{
  "CatalogEntryPoint": {
    "$type": "EPiServer.Find.Cms.IndexableContentReference, EPiServer.Find.Cms",
    "ID$$number": 1073742170,
    "WorkID$$number": 0,
    "ProviderName$$string": "CatalogContent",
    "GetPublishedOrLatest$$bool": false,
    "IsExternalProvider$$bool": true,
    "___types": [
      "EPiServer.Find.Cms.IndexableContentReference",
      "EPiServer.Core.ContentReference",
      "System.Object",
      "System.IComparable",
      "EPiServer.Data.Entity.IReadOnly"
    ]
  },

It would seem that the CatalogEntryPoint.ID-dot-notation does not work as I'm getting 0 results. How should I write it?

Thanks!

-Emil

#86998
Jun 06, 2014 8:25
Vote:
 

I think you're confusing two parts of the EPiServer API.

The first code is for FindPagesWithCriterion. The other is for EPiServer find.

Could you describe what you want to do to help us describe whether FindPagesWithCriterion or Find would be better?

#86999
Jun 06, 2014 10:19
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.