Select Page

Alfresco Content and Process Tips-and-Tricks

Zia has compiled a page of general questions about Alfresco Content Services and Alfresco Process Services. Don’t see a solution that works for you? Scroll down to contact Zia today.
 
  • image/svg+xmlimage/svg+xml
    Will my growing repositories require more memory for Solr?
    There is no single formula to calculate the memory required for Solr. Regardless of the amount of memory dedicated to Solr, plan to increase it as your content repository grows. The chart below shows a real-life example. It is used only for illustrative purposes, as your repository will probably be different. This example has a few properties per document and content is not indexed.    SolrMemory See our article Two Mistakes to Avoid with Alfresco Solr Memory
  • image/svg+xmlimage/svg+xml
    How do I find the creation date for all users?
    Knowing each user’s creation date in Alfresco helps to track the user base growth and estimate future requirements. While documents and folders have the cm:created and cm:modified properties, Alfresco does not keep such metadata for users.   Solution: by default, Alfresco creates a home folder when a user is created. You can probably use the cm:created date from the users’ home folders to know the creation date for specific users.
  • image/svg+xmlimage/svg+xml
    A user can’t log In on Alfresco Share - How do I fix this?
    Sometimes one user can’t log in on Share, but everybody else can. If this happens, it is possible that the user’s preferences have been corrupted. The user’s preferences are stored in an internal, small document in Alfresco. This is a rare and random issue. However, you will likely come across it if you have been using Alfresco Share, with a large enough user base, for some time.    Symptoms: The user is no longer able to log in or is able to get authenticated in other applications, but not in Share. You may see a cryptic message in the logs mentioning “preferences”.   Cause: The user preferences got corrupted.   Solution: Use a REST API call to DELETE the user’s Share Preferences. Then replace the following parameters in the curl command below: Note, curl is also available as a utility for Windows on the web
    • hostname
    • port
    • user_id - the id of the user that can’t log in (e.g., abeecher)
    • admin_user - the admin user (usually this is admin)
    • admin_password - the admin user password
     
    curl https://hostname:port/alfresco/service/api/people
    /user_id/preferences -u admin_user:admin_password -X DELETE
    						
  • image/svg+xmlimage/svg+xml
    How do I view indexed values in Solr console?
    Indexed Solr ValuesSometimes direct queries are made in the Solr console instead of using the repository to get search results. Here is a basic recipe: Navigate to the Solr admin console. I’m using docker-compose to run Alfresco Content Services 7.1.N for development. You’ll need to figure out how to inject a secret or use SSL if you are using Search Services 2.0.3 or above. For me, the URL for loading the Solr admin console is: https://localhost:8083/solr. Select the Alfresco core in the dropdown menu on the left. Then select the “Query” tool. On the query screen, I suggest changing the “Request Header (qt)” to “/select” to “/afts”. This means using the Alfresco Full Text Search syntax rather than pure Lucene syntax. Your query goes into the “q” field like this:  PATH:/app:company_home/*”. You can set the start and rows values to control what part of the result you see. For example, if the start is set to 1000 and rows are set to 2, you will see the first 2 items after the first 1000 results. For the above query I set the start to 0 and the rows to 3. When you click “Execute Query” you’ll get some header data and then results that look like this:
     "response":{"numFound":7,"start":0,"docs":[
          {
            "DBID":25,
            "id":"_DEFAULT_!8000000000000019"},
          {
            "DBID":14,\
            "id":"_DEFAULT_!800000000000000e"},
          {
            "DBID":27,
            "id":"_DEFAULT_!800000000000001b"}]
      },
    If you also set the the “fl” (field list) field to “[cached]*”, then each of the found documents will include all of the field-values associated with the found document: Following are just some of the properties returned for that first document with DBID “25”:  
    
         "cm:title":["Guest Home"],
         "cm_title":"Guest Home",
         "cm:description":["The guest root space"],
         "cm_description":"The guest root space",
         "app_icon":"space-icon-default",
         "cm_creator":"System",
         "sys_node-uuid":"9d2114a2-aa6d-4f47-a259-68d5985906bd",
         "sys_store-protocol":"workspace",
         "cm_name":"Guest Home",
         "sys_node-dbid":25,
         "sys_store-identifier":"SpacesStore",
         "sys_locale":"en_US_",
         "cm_modifier":"System",
         "LAST_INCOMING_CONTENT_VERSION_ID":-20,
         "LATEST_APPLIED_CONTENT_VERSION_ID":-20,
         "_version_":1732380684928942080,
         "cm_created_unit_of_time_day_of_month":9,
    
    It can be incredibly beneficial to see exactly how fields are named and what values are stored in them in the index. Starting with Search Services 2.0, you can see the full text of your documents in this output as the value of the cm_content property. The above example probably returned folders so you may not find any results with this field. A query in “q” that does return one or more documents has many properties indexed with each document. It may simplify things to set the “fl” field to something like “[cached]cm_name,[cached]cm_content”. This will show the name and textual content for each found document.
  • image/svg+xmlimage/svg+xml
    How do I access Solr console with secure comms?
    The plain HTTP communication method between Alfresco and Solr was removed starting with Search Services 2.0.3 and Alfresco Content Services 7.2. You have to either use the “secure” comms method or SSL.   
    WARNING: The SSL method should be used in environments where the Solr server is not completely locked down.
    Often, deployments that lock down Solr use the plain HTTP communication method. With these environments, switching to the “secure” comms method can make it possible to navigate to the admin console. However, that also requires that the shared secret exist in any browser requests. In Firefox, we can use the Modify Header Value addon to inject an “X-Alfresco-Search-Secret” header into any web request from our browser to Solr.   Access Solr Console Example from my docker-compose 7.2 development environment:  
    URL https://localhost:8083/solr/
    Domain Checked
    Sub Checked
    Header Name X-Alfresco-Search-Secret
    Add Checked
    Modify Unchecked
    Remove Unchecked
    Header Value secret
    State ACTIVE
      Of course if you have configured a different header/secret, you can adjust the configuration accordingly.
  • image/svg+xmlimage/svg+xml
    How do I trace network traffic for running Docker container
    Sometimes we need to perform a tcpdump, or even use a tool like WireShark to investigate network traffic between hosts. When using Docker, we often end up with our container processes running on virtual networks. The nicolaka/netshoot Docker image has a bunch of networking tools, including termshark. This is a text based version of WireShark. If you know the name of your container (e.g., docker-compose-solr6-1 in this case), you can run an instance of the netshoot container attached to the same network as your named container. Then spin up termshark using a command like this:  
    docker run -it –rm --net container:docker-compose-solr6-1 \
    
        --cap-add=NET_ADMIN --cap-add=CAP_NET_RAW nicolaka/netshoot \
    
        termshark -i=eth0
  • image/svg+xmlimage/svg+xml
    What is Alfresco search results limit?
    Alfresco search returns a maximum 1000 results. This is controlled by 2 properties:  
    system.acl.maxPermissionCheckTimeMillis=10000
    
    system.acl.maxPermissionChecks=1000
    Increasing these values should give more results. However, we need to be careful not to increase to a number that is too high because it will impact performance. If you need an unlimited number of results, you are better off implementing progressive loading of the search results, or running the query as an admin in the background and emailing the results.
  • image/svg+xmlimage/svg+xml
    What is the right way to extend Alfresco Digital Workspace?
    Angel Borroy, the Alfresco Developer Evangelist, wrote an article about the right way to build extensions for the Alfresco Content App. This provides the basis for Alfresco Digital Workspace. The source code for Digital Workspace is only available to enterprise customers with access to artifacts.alfresco.com.
  • image/svg+xmlimage/svg+xml
    How do I disable auto-suggest?
    The Solr auto-suggest feature is enabled in one place in Share. It provides auto-completion based on the search term the user is typing. This has been found to block indexing of new content when you start SOLR for minutes to hours. It leaves files on disk that you have to clean up manually. This takes extra CPU and RAM every hour and provides a feature that most customers won’t notice. Setting the following property to false in alfresco-global.properties and the solrcore.properties files in both alfresco and archive cores turns this feature off:  
    solr.suggester.enabled=false
    More details on this can be found in the article written by Angel Borroy.
  • image/svg+xmlimage/svg+xml
    How much content is not yet indexed; Search Services 2.x?
    Because metadata and content are indexed in parallel (meta first then content), it can appear that indexing is finished when all the metadata has been indexed. If you need to know how much content is left to be indexed, Angel Borroy came up with a nice Solr query.

Do you have a technical question for our team?

Didn’t find the answer you were looking for? Contact our team today and we’ll get back to you within the next couple business days about your question.

Pin It on Pinterest