You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "zhouxu (JIRA)" <ji...@apache.org> on 2019/06/18 11:05:00 UTC

[jira] [Created] (OAK-8409) oak integration Solr without osgi

zhouxu created OAK-8409:
---------------------------

             Summary: oak integration Solr without osgi
                 Key: OAK-8409
                 URL: https://issues.apache.org/jira/browse/OAK-8409
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: 1.14
            Reporter: zhouxu


1.we try to create repository like these code[1] ; 
2. deployed remote solr server and  put files (schema.xml, solrconfig.xml )which from oak-solr-core artifact into solr server 
3.create  oak:QueryIndexDefinition node like these: 
     Node index = root.getNode("oak:index"); 
     Node solr=index.addNode("solr","oak:QueryIndexDefinition"); 
     solr.setProperty("type", "solr"); 
     solr.setProperty("async", "async"); 
     solr.setProperty("reindex", true); 

problem:if I commit new nodes they are not send to the Solr server for indexing. 

create repository code[1]: 

   RemoteSolrServerProvider remoteSolrServerProvider=null; 
            String solrURL="http://localhost:8983/solr/oak"; 
            SolrServerConfiguration<RemoteSolrServerProvider> remoteSolrServerProviderSolrServerConfiguration = 
                    new RemoteSolrServerConfiguration(null, null, 1, 1, 
null, 10, 10, solrURL); 
            try { 
                remoteSolrServerProvider = 
remoteSolrServerProviderSolrServerConfiguration.getProvider(); 
            } catch (IllegalAccessException e) { 
                e.printStackTrace(); 
            } catch (InvocationTargetException e) { 
                e.printStackTrace(); 
            } catch (InstantiationException e) { 
                e.printStackTrace(); 
            } 

            OakSolrConfigurationProvider configurationProvider = new 
OakSolrConfigurationProvider() { 
                @Override 
                public OakSolrConfiguration getConfiguration() { 
                    return new DefaultSolrConfiguration() { 
                        @Override 
                        public int getRows() { 
                            return 50; 
                        } 
                    }; 
                } 
            }; 
            SolrQueryIndexProvider solrQueryIndexProvider=new 
SolrQueryIndexProvider(remoteSolrServerProvider, configurationProvider); 

            if (repository == null) { 
                repository = new Jcr(new Oak(documentNodeStore)) 
                        .with(solrQueryIndexProvider) 
                        .with(new NodeStateSolrServersObserver()) 
                        .with(new 
SolrIndexEditorProvider(remoteSolrServerProvider, configurationProvider)) 
                        .with(new SolrIndexInitializer(false)) 
                        .createRepository(); 
            } 




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)