Best practices for Alfresco SOLR customisation

cancel
Showing results for 
Search instead for 
Did you mean: 
jego
Partner

Best practices for Alfresco SOLR customisation

Hi,

can anybody tell me what are best practices to modify Alfresco SOLR behaviour?

Which parts can be configured safely without having problems in a next patch/minor/major release?

For example, I would like to have a custom tokenizer for the model property cm:name.

What should I do here?

  • Modify the solrSchema?
  • Modify contentModel in Alfresco to set tokenised to false?

As I have understood here (Searching with Alfresco 5.1 Community), Solr stores different field mappings:

text@s____@{http://www.alfresco.org/model/content/1.0}name = single value

Thanks

Jens

2 Replies
afaust
Master

Re: Best practices for Alfresco SOLR customisation

I guess if you were talking to Alfresco Support or any of the Alfresco Engineers the best practice would be to NOT customise SOLR. On every occasion when new SOLR features are announced / demoed, one of my standard questions is about customisability and the sad truth is that Alfresco does not consider this to be a priority or even e necessity.

Some tokenisation rules are unfortunately hard-coded and configuration does not affect anything. In the past this has been true for cm:userName, cmSmiley Surprisedwner and cm:author (AFAIK).

What I have done in the past without issue:

- make generic changes in schema.xml on dynamicFields instance that were still using legacy / oldStandardAnalysis

- make changes to solrconfig.xml to add pre-/post-processing, e.g. mapping a more extensive JSON request (including facets which are normally encoded in the URL causing URL length issues) to the actual request, or registering custom search components for custom query languages (slight enhancements over default FTS)

I guess you should be able to safely specify a custom fieldType + field for a model property to override the default from its dynamicField. But I have not tried that yet.

jego
Partner

Re: Best practices for Alfresco SOLR customisation

Axel,

great. Thanks for helping out.

My current change is to set tokenised in contentModel.xml to false for cm:name. (copied contentModel.xml in my project)

It just did what my customer wants, but I am not sure if this has any side effect. In my eyes, nothing in Share should rely on the tokensiation of cm:name, but...

Thanks

Jens