I have configured Solr Remote Server integration following steps as per reference. I can see the content getting indexed to the remote solr server. As per the reference link
"The purpose of the Solr index is mainly full-text search but it can also be used to index search by path, property restrictions and primary type restrictions. This means the Solr index in Oak can be used for any type of JCR query."
As per above statement, I am assuming as solr index configuration resides on AEM (under oak:index), the query builder should return results for solr index also. When I query through query builder, I see following messages in logs. The query is not returning any results. But if I query the solr admin for same (http://localhost:8983/solr/gettingstarted/select?indent=on&q=admin&wt=json), that is returning results. If I disable solr index, the querybuilder returns some results using lucene index.
23.02.2017 16:39:28.425 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl executing query (URL): fulltext=admin 23.02.2017 16:39:28.425 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl executing query (predicate tree): ROOT=group: [ {fulltext=fulltext: fulltext=admin} ] 23.02.2017 16:39:28.426 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl xpath query: //*[jcr:contains(., 'admin')] 23.02.2017 16:39:28.426 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.query.QueryEngineImpl Parsing xpath statement: //*[jcr:contains(., 'admin')] 23.02.2017 16:39:28.426 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.query.QueryEngineImpl XPath > SQL2: select [jcr:path], [jcr:score], * from [nt:base] as a where contains(*, 'admin') /* xpath: //*[jcr:contains(., 'admin')] */ 23.02.2017 16:39:28.426 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl cost using filter Filter(query=select [jcr:path], [jcr:score], * from [nt:base] as a where contains(*, 'admin') /* xpath: //*[jcr:contains(., 'admin')] */ fullText="admin", path=*) 23.02.2017 16:39:28.427 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl cost for solrindex is 2.323.02.2017 16:39:28.427 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl cost for aggregate lucene is 223255.0 23.02.2017 16:39:28.427 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl cost for lucene-property is Infinity 23.02.2017 16:39:28.427 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl cost for reference is Infinity 23.02.2017 16:39:28.427 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl cost for ordered is Infinity 23.02.2017 16:39:28.427 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl cost for nodeType is Infinity 23.02.2017 16:39:28.427 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl cost for property is Infinity 23.02.2017 16:39:28.427 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl cost for traverse is Infinity 23.02.2017 16:39:28.427 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl xpath query creation took 2 ms 23.02.2017 16:39:28.427 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl query execute select [jcr:path], [jcr:score], * from [nt:base] as a where contains(*, 'admin') /* xpath: //*[jcr:contains(., 'admin')] */ 23.02.2017 16:39:28.427 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl query plan [nt:base] as [a] /* { costPerExecution : 2.0, costPerEntry : 0.3, estimatedEntryCount : 1, filter : Filter(query=select [jcr:path], [jcr:score], * from [nt:base] as a where contains(*, 'admin') /* xpath: //*[jcr:contains(., 'admin')] */ fullText="admin", path=*), isDelayed : true, isFulltextIndex : true, includesNodeData : true, sortOrder : null, definition : null, propertyRestriction : null, pathPrefix : / } where contains([a].[*], 'admin') */ 23.02.2017 16:39:28.455 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl >> xpath query returned 0 results (getSize)23.02.2017 16:39:28.455 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl query execute select [jcr:path], [jcr:score], * from [nt:base] as a where contains(*, 'admin') /* xpath: //*[jcr:contains(., 'admin')] */ 23.02.2017 16:39:28.455 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl query plan [nt:base] as [a] /* { costPerExecution : 2.0, costPerEntry : 0.3, estimatedEntryCount : 1, filter : Filter(query=select [jcr:path], [jcr:score], * from [nt:base] as a where contains(*, 'admin') /* xpath: //*[jcr:contains(., 'admin')] */ fullText="admin", path=*), isDelayed : true, isFulltextIndex : true, includesNodeData : true, sortOrder : null, definition : null, propertyRestriction : null, pathPrefix : / } where contains([a].[*], 'admin') */ 23.02.2017 16:39:28.471 *DEBUG* [0:0:0:0:0:0:0:1 [1487848168423] GET /bin/querybuilder.json HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl entire query execution took 46 ms
Update - getting below WARN in error.log, missed this as had created separate logger for search related packages, will update if I find anything more to this
23.02.2017 18:33:46.309 *WARN* [0:0:0:0:0:0:0:1 [1487855026273] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.plugins.index.solr.query.SolrQueryIndex query via org.apache.jackrabbit.oak.plugins.index.solr.server.OakSolrServer@3bb62495 failed. org.apache.solr.client.solrj.SolrServerException: org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: undefined field catch_all
Update 2 - Trying Embedded option doesn't gives this error and query builder returns proper results and ACLs are respected. So there is definitely something to do with configuration of remote solr option, will update if I find anything more to this.
Update 3 - When configured with Solr 4.9.1 version, the indexing is working fine. Not getting the undefined field catch_all error. But when querying through query builder, still get following error (though server is accessible using IP). One observation was it was using IP of machine while querying, though configurations has localhost)
Caused by: org.apache.solr.client.solrj.SolrServerException: No live SolrServers available to handle this request:[http://<local_machine_ip>:8983/solr/oak, http://<local_machine_ip>:7574/solr/oak] at org.apache.solr.client.solrj.impl.LBHttpSolrServer.request(LBHttpSolrServer.java:387) at org.apache.solr.client.solrj.impl.CloudSolrServer.request(CloudSolrServer.java:635) at org.apache.jackrabbit.oak.plugins.index.solr.server.OakSolrServer.request(OakSolrServer.java:53) ... 156 common frames omitted Caused by: org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Server Error request: http://<local_machine_ip>:7574/solr/oak/select?q.op=AND&fl=path_exact score&df=catch_all&rows=2147483647&q=catch_all:Triangle &wt=javabin&version=2 at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:495) at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:199) at org.apache.solr.client.solrj.impl.LBHttpSolrServer.request(LBHttpSolrServer.java:302)
Please help me understand the correct way to test the AEM Solr Remote integration. Thanks.
- Sandeep