cancel
Showing results for 
Search instead for 
Did you mean: 

solr Indexing taking too much time...

arpit_gupta
Champ in-the-making
Champ in-the-making
Hello friends,

I have integrated REST services with solr subsysten in my application.

I am uploading documents with metadata  using default upload and metadata scripts. and after uploading data and updating metadata i search alfresco for documents on the basis of metadata.

Now the problem is alfresco is not returning currently uploaded document in search results and hence i can not show the correct document list on application UI and that's why user think that document is not uploaded.

Though if i fire the search script 2-3 times more i get the correct result. I guess alfresco is taking time in indexing the metadata.

I am in real trouble here. Any help??

Thanks,
Arpit
12 REPLIES 12

mrogers
Star Contributor
Star Contributor
If you are using SOLR you must take account of the fact that there will be a delay (however short) between uploading content and being able to search for it. 

There are a couple of approaches.  
a) Don't use search to find a document you just uploaded, use one of the other APIs such as a lookup by noderef or list the contents of a folder.    That's how Alfresco Share works.
b) Don't use SOLR, use the in transaction Lucene index subsystem instead.

lesignor
Champ in-the-making
Champ in-the-making
Can you help me to find a javascript api to lookup for a new node from its noderef, something like search.findNode(..), but this API uses lucene index to work.

Thank you

arpit_gupta
Champ in-the-making
Champ in-the-making
i have to do search on metadata and i have to show document list on the basis of that metadata.
Hence a search on folder or noderef will not work.

So that means i can not use solr subsystem in this scenario  Smiley Sad
Isn't there any other way to resolve this problem without dropping solr?

mrogers
Star Contributor
Star Contributor
No.

acarpine
Champ in-the-making
Champ in-the-making
mroger really thanks for your clarifications.
What is not clear for me is how to specify/change how often solr must run.

From http://wiki.alfresco.com/wiki/Alfresco_And_SOLR i thought that the property was
alfresco.cron=0/15 * * * * ? *
    How often to check if there is work to do

Although alfreco.cron sets the interval every 15 minutes, in my Alfresco installation I'm able typically to retrieve a node by metadata just after 20/30 seconds while in other installations the time to wait seems significantly longer. Could you explain what's the correct parameter or where this parameter is overridden?

Thanks,
Andrea

mrogers
Star Contributor
Star Contributor
I think that cron expression is 15 seconds.

acarpine
Champ in-the-making
Champ in-the-making
Ops right…Many thanks mrogers!

srm
Champ in-the-making
Champ in-the-making
I am in the same boat as some one, where an uploaded document is not immediately available for search. I am using the SOLR subsystem as well. As i see from earlier answers, i should consider changing the subsystem from solr to lucene. Could anybody tell, how to change the subsystem from solr to lucene? are there any disadvantages by doing this?  I am using Alfresco 4.0 version.

Is it true that indexing is less important in Alfresco 4.0 and it is advised to turn off this feature?

mrogers
Star Contributor
Star Contributor
Could anybody tell, how to change the subsystem from solr to lucene?
    Please see the documentation for the search subsystem.
-> are there any disadvantages by doing this?
    Performance is affected by having in transaction indexing,  you can't index offline or share indexes between a cluster of servers.
Is it true that indexing is less important in Alfresco 4.0 and it is advised to turn off this feature?
-> Its not essential like it used to be but search is an important part of alfresco.