Examine - Field $facets was not indexed with Sorte...
# help-with-umbraco
b
I'm currently using the newest beta version of Examine to use faceting in an Umbraco13 site. After adding a new language (added Dutch to the already existing English) I get the error: 'field "$facets" was not indexed with SortedSetDocValues' Is anyone familiair with this? It seems to be something going on withing Examine since I do not specify a field called '$facets"
n
What is the value type of the field see https://shazwazza.github.io/Examine/articles/configuration.html. Are you using the Taxonomy Index eg / Create a config var facetsConfig = new FacetsConfig(); // Set field to be able to support hierarchical facets facetsConfig.SetHierarchical("hierarchyFacetfield", true); // Set field to be able to contain multiple values (This is default for a field in Examine. But you only need this if you are actually using multiple values for a single field) facetsConfig.SetMultiValued("MultiIdField", true); services.AddExamineLuceneIndex("MyIndex", // Set the indexing of your fields to use the facet Taxonomy type fieldDefinitions: new FieldDefinitionCollection( new FieldDefinition("Timestamp", FieldDefinitionTypes.FacetTaxonomyDateTime), new FieldDefinition("hierarchyFacetfield", FieldDefinitionTypes.FacetTaxonomyFullText), new FieldDefinition("MultiIdField", FieldDefinitionTypes.FacetTaxonomyFullText) ), // Pass your config facetsConfig: facetsConfig, // Enable the Taxonomy sidecar index useTaxonomyIndex: true );
Thanks again for the help 🙂
n
From memory, when you add a new language, Umbraco automatically adds a new field in examine for that language / property combination. Examine would be querying on a field that does not have the right field type as by default it will get fulltext and not facet full text. The $facets field is where the facet counts are stored when not using the taxonomy index.
You would need to find out the name of this new field that is created per language and set the correct field type and dims on it too.
b
Thanks! I've added a new field for each culture with the FacetFullText type and I fill this based on the culture but the error persists. All fields should be correct this way, right? I have the feeling that I'm missing something. All fields are now indexed per culture and the requested culture should be able to be retrieved in the indexer. Do you know what i'm doing wrong? The code has now been changed to this: https://cdn.discordapp.com/attachments/1257684691637764246/1259789407649533993/image.png?ex=668cf5d0&is=668ba450&hm=7b259a30bc483fc3b2fe43ba459c4ffb21911cfc5c061a06cb66c2399aa941d5& https://cdn.discordapp.com/attachments/1257684691637764246/1259789408022958140/image.png?ex=668cf5d0&is=668ba450&hm=5cef8a0a939e46b9539d9083139e4521ea788dfe01bb5921e90113f61587841a&
n
I'd suggest using the Luke tool to check the fields configured. Or create a minimal repo with your setup.
b
Thanks a lot for all the help, we managed to fix it. There was an issue where the pages weren't being published in the correct language. We fixed that and followed your advice for setting the correct dims and it works now
r
Hey, I am about to work on a Facets task with Examine? Is it supported now OOB with Examine search? Is there any Blog post about that?
I found it: https://shazwazza.github.io/Examine/articles/configuration.html also info in Searching section
@Bram It looks from the pictures (especially comments) like you did a great investigation around the Facets. Have you shared your findings somewhere in a blog post or public git repo?
b
It was indeed a bit of a search. We've build it on a prerelease version since the feature hasn't been fully released yet. I've never written a blog so I haven't shared it anywhere public. I could share some code snippets if you'd like? As far as I remember the main issue had to do with multilingual fields and not with the actual facetting itself.
r
@Bram I just realized it is still not released but is in 4 beta. It is annoying that the Examine docs site doesn't say anything about versions. Do you use these faceting feature on Production? Did you install the beta package? I've been reading for some time, even somewhere in an older faceting nuget package was said that it is recommended to use the default implementation since on but nobody really says it is in beta 😄 I figured it out when I tried to access FieldDefinitionTypes.FacetFullText and I didn't have it.
b
Yeah I'm using the beta version on production now. There was a release that fixed some other stuff last week but I heard that that'll tank the performance of some queries.
r
Hey @Bram. I started on this task today. So far it is going well but I was wondering how do you handle the translations/conversions of the Facet Labels? Like for example I have this in the Facets now
Copy code
{
      "label": "contentPage",
      "value": 6
  },
  {
      "label": "homePage",
      "value": 1
  }
I can imagine that labels can also be some IDs if you use some content picker. Do you handle the translation (user friendly label) as a post-search operation, before passing the data for presentation, or you kind of put in the facet already 'nice looking' labels during indexing?
b
Great to hear that you're working on it! I've seen 2 different implementations of this in the projects that i've worked on. 1: There is a seperate API call that retrieves all the filters as key/value pairs. When a facet is clicked, the id is sent to the backend and therefore the backend doesn't need to know the names. 2: All results are thrown into a function, which uses the UmbracoContextFactory to get the label for each facet. I personally like the second option a better. But perhaps it would also be a good option to index the actual names of the facets as well. Although I can see this becoming a bit overcomplicated
121 Views