Try our conversational search powered by Generative AI!

New EPiServer Find returns JSON Error

Vote:
 

When I try to do a simple search on a pagetype I get this error:

{"Property 'PageCategory' does not exist, can only assign values to existing properties"}

I thought that property was built in and not able to remove and I do not know that I have done anything to remove it.

Anyone else got this?

By the way, this works:
var queryContentResultFromPage = SearchClient.Instance.Search<StandardPage>().For("lernia").GetContentResult();

and this does not work:
var queryResultFromPage = SearchClient.Instance.Search<StandardPage>().For("lernia").GetResult();

#86435
May 21, 2014 15:02
Vote:
 

You should always use GetContentResult() for ContentData. GetResult() doesn't work in "old" Find either. If you remove PageCategory from  the index, you will get an error on another property instead, usually PageName.

#86443
May 21, 2014 15:45
Vote:
 

That is true Johan, this has started to work after I fixed the assambly-errors in the other thread so it is not so urgent now.

A question, is it hard to make a custom object (I index a lot of stuff that are not inside EPiServer) to inherit from IContent? For example this class

using EPiServer.Find;

namespace ActiveSolution.Customer.Entities.EPiServerFind
{
    public class ContactPersonToIndex
    {
        [Id]
        public string Id { get; set; }
        public string KomplettTitel { get; set; }
        public string HeadTitle { get; set; }
        public string FreeTextTitle { get; set; }
        public string Name { get; set; }
        public string Email { get; set; }
        public string Phone { get; set; }
        public string ImagePath { get; set; }
        public string StreetAddress { get; set; }
        public string PostalCode { get; set; }
        public string Ort { get; set; }
        public string Corporation { get; set; }
    }
}
#86446
May 21, 2014 16:40
Vote:
 

I don't see the reason why you want to do that, unless you want to expose the objects in the UI and have a content provider. By having a conten provider you can use the cms apis to query data, like GetChildren() and so on.

#86449
May 21, 2014 18:05
Vote:
 

That is true Johan, the only reason I can think of is that I would be able to use GetContentResult in Find with it built in functions for cache and so and that is why I have not done it yet.

I am using Unified Search for my main content and GetResult for my other objects and it works now when I fixed the assambly problem.

Thanks

#86452
May 21, 2014 20:25
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.