cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 4.0 Solr problem

mcasanket
Champ on-the-rise
Champ on-the-rise
Hi all,

  I have just installed alfresco 4.0 and I want to use Solr in my project.
  I have put the following lines in my global.prop file and it is working fine. Does it mean the SOLR is working?
### Solr indexing ###
index.subsystem.name=solr
dir.keystore=${dir.root}/keystore
solr.port.ssl=8443
## newly added.
solr.host=localhost
solr.port=8080

I have read many thing like following.
encryption.ssl.keystore.location=
encryption.ssl.keystore.provider=
encryption.ssl.keystore.type=
encryption.ssl.keystore.keyMetaData.location=

I am having keystor files in alf_data folder. What should i put in the keystor.provider, keystor.type and what is the keymetadata.location?
If I give this correctly then only SOLR works?

I am able to see the SOLR home page and can also fire a query. But it give me the following exception.

HTTP Status 400 - org.apache.lucene.queryParser.ParseException: Cannot parse '@cm:name:sanket': Encountered " ":" ": "" at line 1, column 8. Was expecting one of: <EOF> <AND> … <OR> … <NOT> … "+" … "-" … "(" … "*" … "^" … <QUOTED> … <TERM> … <FUZZY_SLOP> … <PREFIXTERM> … <WILDTERM> … "[" … "{" … <NUMBER> …

Please help me out….!
10 REPLIES 10

jpfi
Champ in-the-making
Champ in-the-making
Hi,
I guess you you have to escape the first ":" if your're using lucene and not alfresco-fts:
–> @cm\:name:sanket'
Cheers, jan

mcasanket
Champ on-the-rise
Champ on-the-rise
Thanks for your reply!  Smiley Very Happy
   When I run the query form browser https://localhost:8443/solr/alfresco/admin/ I am getting either no error but shows numFounds=0 or the exception which is in main topic.

Hi,
I guess you you have to escape the first ":" if your're using lucene and not alfresco-fts:
–> @cm\:name:sanket'
Cheers, jan


Thank you!

jpfi
Champ in-the-making
Champ in-the-making
Hi,
You cannot run the query straight from https://localhost:8443/solr/alfresco/admin/ because you've to use the right query component (alfresco adds its own here).
If you use the default one via the solr web interface you've to tweak your search expression…e.g. @{http://www.alfresco.org/model/content/1.0}name:sanket
perhaps you've to escape some chars like @\{http\://www.alfresco.org/model/content/1.0\}name:sanket
That is only a quick hack, you cannot execute this query from alfresco!
Cheers, Jan

mcasanket
Champ on-the-rise
Champ on-the-rise
Hi Jan,
   Thanks for your quick response! The other thing I wanted to know, I am able to log in in alfresco and share both. But How can I identify that the queries are run by SOLR or the old way before SOLR.

However I have set the following things in my glob.prop file.
### Solr indexing ###
index.subsystem.name=solr
dir.keystore=${dir.root}/keystore
solr.port.ssl=8443
## newly added.
solr.host=localhost
solr.port=8080
# default keystores location
dir.keystore=classpath:alfresco/keystore

encryption.ssl.keystore.location=${dir.keystore}/ssl.keystore
encryption.ssl.keystore.provider=
encryption.ssl.keystore.type=JCEKS
encryption.ssl.keystore.keyMetaData.location=${dir.keystore}/ssl-keystore-passwords.properties

encryption.ssl.truststore.location=${dir.keystore}/ssl.truststore
encryption.ssl.truststore.provider=
encryption.ssl.truststore.type=JCEKS
encryption.ssl.truststore.keyMetaData.location=${dir.keystore}/ssl-truststore-passwords.properties




Hi,
You cannot run the query straight from https://localhost:8443/solr/alfresco/admin/ because you've to use the right query component (alfresco adds its own here).
If you use the default one via the solr web interface you've to tweak your search expression…e.g. @{http://www.alfresco.org/model/content/1.0}name:sanket
perhaps you've to escape some chars like @\{http\://www.alfresco.org/model/content/1.0\}name:sanket
That is only a quick hack, you cannot execute this query from alfresco!
Cheers, Jan

jpfi
Champ in-the-making
Champ in-the-making
Hi,
just enable debug logging in log4j.properties:
log4j.logger.org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient=debug

Cheers, Jan

mcasanket
Champ on-the-rise
Champ on-the-rise
Hi Jan,
    I have enabled the debugging in both the log4j.prop files.

    C:\AlfrescoSolr\tomcat\webapps\share\WEB-INF\classes\log4j.properties
    C:\AlfrescoSolr\tomcat\webapps\alfresco\WEB-INF\classes\log4j.properties

But whenever I do any operation like log in, going into site or clicking on any link. It doesn't print anything on console.   Smiley Indifferent


Hi,
just enable debug logging in log4j.properties:
log4j.logger.org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient=debug

Cheers, Jan

mcasanket
Champ on-the-rise
Champ on-the-rise
Hi,

One more thing to add, When I go to https://localhost:8443/solr/alfresco/admin/ping it shows me the following result.

{"responseHeader":{"status":0,"QTime":16,"params":{"echoParams":"all","echoParams":"all","q":"solrpingquery","qt":"standard"}},"status":"OK"}

Does it mean that Solr is not working properly?

Thanking you!

jpfi
Champ in-the-making
Champ in-the-making
Hi,
your solr is up & running. But the question is if your alfresco-solr connection is working properly.
if you activated solr as search subsytem (index.subsystem.name=solr), activated (log4j.logger.org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient=debug) & execute a search in Share you should view some logs…
jan

mcasanket
Champ on-the-rise
Champ on-the-rise
Hey Thank you so much Jan,

   I made a mistake yesterday while enabling a log in log4j file (Spelling mistake)  Smiley Surprisedops: and that was the reason the logs were not getting printed.
Today when I correct that spelling error It shows me logs when I click any link or search something in Share!  Smiley Very Happy

Logs:
 2011-12-15 11:00:40,433  DEBUG [impl.solr.SolrQueryHTTPClient] [http-8080-8]    with: {"textAttributes":[],"allAttributes":[],"templates":[],
brary//*\" +@cm\\:modified:[2011\\-12\\-8T00\\:00\\:00.000 TO 2011\\-12\\-15T23\\:59\\:59.999] +@cm\\:modifier:\"admin\" +TYPE:\"cm:content\"
rum\" -TYPE:\"fm:topic\" -TYPE:\"fm:post\" +(TYPE:\"content\" OR TYPE:\"app:filelink\" OR TYPE:\"folder\")","locales":["en_US"],"defaultNamesp
SFieldOperator":"OR","defaultFTSOperator":"OR","filter":"|AUTHORITY:\"GROUP_ALFRESCO_ADMINISTRATORS\" |AUTHORITY:\"GROUP_EMAIL_CONTRIBUTORS\"
\" |AUTHORITY:\"GROUP_site_swsdp_SiteManager\" |AUTHORITY:\"ROLE_ADMINISTRATOR\" |AUTHORITY:\"ROLE_AUTHENTICATED\""}
2011-12-15 11:00:40,433  DEBUG [impl.solr.SolrQueryHTTPClient] [http-8080-8] Got: 1 in 1469 ms

It means my alfresco and share both are using SOLR now. Jan when I run the SOLR UI (https://localhost:8443/solr/alfresco/admin/) It is not working properly… like simple query @cm\:name:"sanket" is not working…  Even I don't know that whether it is able to connect to the repository or not!  :?  How can I know that?



Hi,
your solr is up & running. But the question is if your alfresco-solr connection is working properly.
if you activated solr as search subsytem (index.subsystem.name=solr), activated (log4j.logger.org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient=debug) & execute a search in Share you should view some logs…
jan

Thank you!