November Happy Hour will be moved to Thursday December 5th.

Custom types has no name or type description in Explore-view

Vote:
 

As seen below, when I get hits for custom types in the index, they show up as blank lines. I can open and browse then without problem, but the fact that they have no name makes this Explore-view near-useless.

I can see that pages, blocks and other CMS/Commerce-types have a property in the JSON called "_Name", which I suspect is being used for this. If I add this to my model, it shows up as "_Name$$string", and is not picked up by the GUI.

Is there any way to fix this or add some special property or whatever to this that can make the names show up in some way? This should be documented somewhere (it might be, but I have not found it...), as a *major* part of the entire search engine is utterly useless for editors.

Also, "Filter by type" to the right is unable to filter by the custom types - and I have no idea why. Shouldn't this just be a facet of the different types (the "$type" field), regardless of if it's CMS content/commerce content or not? The information is already in the index - to me it seems that stuff is purposly left out, which makes no sense whatsoever.

#89361
Aug 14, 2014 11:48
Vote:
 

Image here, this forum won't let me insert it directly: http://bildr.no/view/b3diU0F1

#89362
Edited, Aug 14, 2014 11:49
Vote:
 

I suppose this is a bug. However, you could give this sort of hacky solution a shot:

SearchClient.Instance.Conventions.ForInstancesOf().IncludeField(x => x.GetOriginalType().Name);
SearchClient.Instance.Conventions.ForInstancesOf().Field(x => x.GetOriginalType().Name).Modify(x => x.PropertyName = "_TypeShortName");
SearchClient.Instance.Conventions.ForInstancesOf().IncludeField(x => x.Title.ToString());
SearchClient.Instance.Conventions.ForInstancesOf().Field(x => x.Title.ToString()).Modify(x => x.PropertyName = "Name" + TypeSuffix.String);

This should fix both the name issue and the type issue.
Replace "Title" property with whatever suits you. However, do not remove the calls to ToString, as that will override the original property in the index.

#89387
Aug 14, 2014 19:44
Vote:
 

By the way, the image you posted is a tiny bit on the small side. Or maybe I need to put my glasses on :-)

#89388
Aug 14, 2014 19:51
Vote:
 

Ah, great stuff! Thanks! Will test tomorrow. And the image link has been fixed, bildr.no obviously needs "www" to work properly. :-(

#89390
Aug 14, 2014 20:48
Vote:
 

A bit slow on the testing, but that did work out just perfectly! Should also be fixed somehow in the next patch, preferably with something like an attribute like [DisplayName] or whatever for the property you want to use as the name. :-)

#89560
Aug 20, 2014 9:37
Vote:
 

Great!
It has been reported as a bug, so we'll have to wait and see :-)

#89860
Aug 27, 2014 15:00
Vote:
 

This should have been fixed in the latest release as well

#90124
Sep 02, 2014 14:47
Vote:
 

How can I modify the Name visible in Explore view? Would be great if we could use an attribute for this, like Arve suggests.

I have tried using Per Magne's code, but that is not working - it is still using Name property. I want to fetch it from another property.

PS: I'm using latest version of EPiServer.Find

#90450
Sep 10, 2014 8:58
Vote:
 

The code Per Magne posted should fix the name in Explore view (Im currently at Find 8.2.4.684). By switching "Title", you can stick in whatever you feel like.

Also, remember you have to reindex your content for it to have an effect.

#90452
Sep 10, 2014 9:16
Vote:
 

If you already have a property called "Name", then that property will be used by default. The code I provided will simply create a new field called Name in the index and put the value of your choise in it. However, in Mari's case, where there already is a field called "Name", my code should not be applied, as it will mess up the queries (if you use the name property in queries that is).

#90455
Sep 10, 2014 9:30
Vote:
 

Per Magne - does that mean if I have a property Name already, I'm not able to override what is being used in the Explore view?

#90460
Sep 10, 2014 10:03
Vote:
 

The Explore view tries to use the following properties of an indexed object as a "Name" value in the speicifed order:

  • SearchTitle
  • PageName
  • Name
  • title
  • _id (this an internal ID of the indexed object)

After the latest update there shouldn't be empty lines any more.

#90461
Sep 10, 2014 10:31
Vote:
 

Then I suppose you(Mari) could use SearchTitle or PageName then. Although I suppose the safest way would be to use PageName, as SearchTitle is used in unified search, assuming this is not a pagedata object.

Something like:

SearchClient.Instance.Conventions.ForInstancesOf().IncludeField(x => x.Name.ToString());
SearchClient.Instance.Conventions.ForInstancesOf().Field(x => x.Name.ToString()).Modify(x => x.PropertyName = "PageName" + TypeSuffix.String);


I did not test this though.

#90462
Edited, Sep 10, 2014 10:37
Vote:
 

In my project we don not use unified search. I ended up adding a SearchTitle property to my object which solved it. No need for extra code (conventions).

#90468
Sep 10, 2014 11:27
Vote:
 

whatever floats your boat :-)

#90472
Sep 10, 2014 11:39
* 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.