cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 5.0.a/b doubled facets for d:mltext

streetturtle
Confirmed Champ
Confirmed Champ
It seems that facets doesn't work properly with multi language properties.
I did a simple test in Alfresco 5.0.a and 5.0.b on clean installation:

1. Created a text document in site.
2. Put description in English.
3. Changed browser language to French.
4. Added French version of the description.
5. Searched for the file name.
6. Found only one document which was just created.

The problem is that in Description facet on the left panel I have two descriptions - one English and one French.
Both points to the same file, but logically there should be only one description (depends on the browser's language).

Did anybody facet this problem? It seems like a bug.
3 REPLIES 3

resplin
Elite Collaborator
Elite Collaborator
This is an interesting problem report. Given that faceted search is very new in the product, I think you are right and that this is a bug. I suspect this is an area we haven't added to our test scripts.

Can you please report it at http://issues.alfresco.com ?

It will help others who hit the issue if you add the issue number to this thread.

Thank you for looking in to the problem.

streetturtle
Confirmed Champ
Confirmed Champ
Thanks!

I raised an issue [ALF-21249](https://issues.alfresco.com/jira/browse/ALF-21249)

And also found a workaround, which is a bit dirty, but works well.

Let's say you have a property with name `ccmSmiley Tongueroperty` which has type `d:mltext` and you want to have facet for this property in English and French.

1. Define an aspect with two d:text properties: `ccmSmiley TongueropertyEn` and `ccmSmiley TongueropertyFr`
2. Apply this aspect to the type.
3. When you set the `ccmSmiley Tongueroperty` set also `ccmSmiley TongueropertyEn` and `ccmSmiley TongueropertyFr`properties
4. Modify variable `facets` in `faceted-search.get.js` so that depends on the user's language one or another facet are shown:

<javascript>
if (locale.substring(0, 2)== "fr")
  facetQName = "{http://www.ccm.com/model/ccm/1.0}propertyFr.__.u";
else
  facetQName = "{http://www.ccm.com/model/ccm/1.0}propertyEn.__.u";
facets.unshift(
  {
    id: "FCTSRCH_FACET_DOCUMENT_TYPE",
    name: "alfresco/search/FacetFilters",
    config: {
      label: msg.get("faceted-search.facet-menu.facet.docType"),
      facetQName: facetQName,
      sortBy: "ALPHABETICALLY",
      hitThreshold: 1,
      minFilterValueLength: 5,
      maxFilters: 10,
      useHash: false
    }
  });
</javascript>

Done! Smiley Happy

andy
Champ on-the-rise
Champ on-the-rise
Hi

"{http://www.ccm.com/model/ccm/1.0}propertyFr.__.u";

Is the old SOLR 1 way of doing things.
With SOLR 4 you would do "{http://www.ccm.com/model/ccm/1.0}propertyFr" and let it work out the best facet field …
The SOLR 4 APIs have been fixed up to be more Alfresco schema/model friendly in 5.1.

For description SOLR4 it will facet on tokens rather then use the full string in the description case.
Faceting on the description text (which is not likely to be reused exactly and maybe mostly unique) does not make much sense to me. Token based seem more interesting for this field.

Andy