I am using alfresco community 5.0.d and solr4. Is there a way to index a file in alfresco solr manually through web scritps by turning of the solr tracking?. Whenever a file/folder is created or modified can we selectively index only those changes in solr manually with keeping automatic tracking off by solr?.
Asked
Active
Viewed 632 times
1 Answers
1
I don't know why you're taking the hard way. Solr is ment to follow an Alfresco repo and it's good at it.
Instead use the index aspect to control your content. Take a look here: http://docs.alfresco.com/4.0/concepts/admin-indexes.html Just add a rule or behaviour and set it to default false so it doesn't get indexed.
And when you need to index it, just update the properties.

Tahir Malik
- 6,623
- 15
- 22
-
Thanks for the reply. I wanted to implement encryption in alfresco at file level and also to enable solr to search the content as well . So, i thought of indexing contents of the file in solr and later replace original content with encrypted content in alfresco and keeping the indexes in solr. Will this work?, If so, then i have stop solr from tracking this encrypted data. – Kumar Mullur Nov 04 '15 at 06:05
-
Yeah sure, but if the content is encrypted, then how will you download the file? if you want to embed encryption, then use Alfresco to encrypt & decrypt. Solr asks the content file through Alfresco it never goes directly to the filesystem, that's why Solr doesn't need access to the filesystem. – Tahir Malik Nov 04 '15 at 11:18
-
For download, viewer etc, i have developed custom web scripts in java which will decrypt the content before downloading. I've developed a encryption module which is at a file level not at store level. Is there way where i can use a custom webscript/behaviour in between solr and alfresco?. So that, whenever solr requests for content, this custom service should get triggered which will decrypt the content and pass it to solr to get it indexed. Please let me know. – Kumar Mullur Nov 05 '15 at 06:33
-
Sure, you can. There are webscripts Alfresco uses, /service/api/solr/*, like metadata. These webscripts can only be accessed by an ssl authenticated solr instance. So just change these webscripts and decrypt the data in it, then Solr will index it as normal. – Tahir Malik Nov 05 '15 at 11:06
-
Thanks a lot. It's a big relief for me. Can you guide me a little more on how i can achieve this (on customizing these api's)?. – Kumar Mullur Nov 06 '15 at 07:11
-
These are just normal webscripts and probably they have a Java Backend. So just look these up in the XML files of Alfresco and you'll find if there is Java code related to it. If it is, just re-define the same bean to your custom class. – Tahir Malik Nov 06 '15 at 08:59