Hello,

My quest to get Oak up and running in an OSGi setup continues!
Now I would like to use a Solr index in Oak.
After hours of trial and error, what I've managed to reach so far is to
make Oak communicate with Solr, using a JSON configuration like:

>
> "org.apache.jackrabbit.oak.plugins.index.solr.osgi.NodeStateSolrServersObserverService":
> {
>     "enabled": true
>   },
>
> "org.apache.jackrabbit.oak.plugins.index.solr.osgi.SolrServerProviderService":
> {
>     "server.type": "remote"
>   },
>
> "org.apache.jackrabbit.oak.plugins.index.solr.osgi.OakSolrConfigurationProviderService":
> {
>     "property.restrictions": true,
>     "ignored.properties": ["jcr:data"]
>   },
>
> "org.apache.jackrabbit.oak.plugins.index.solr.osgi.RemoteSolrServerConfigurationProvider":
> {
>     "solr.http.url": "${oak.solr.url}",
>     "solr.zk.host": ""
>   },
>
> "org.apache.jackrabbit.oak.plugins.index.solr.osgi.SolrIndexEditorProviderService":
> {
>
>   },
>
> "org.apache.jackrabbit.oak.plugins.index.solr.osgi.SolrQueryIndexProviderService":
> {
>
>   }
>
I have created the associated node as "/oak:index/solr":

> async
>     async
> jcr:primaryType
>     oak:QueryIndexDefinition
> type
>     solr
>

I have added some nodes of my own types in the repository and I've seen
that these nodes (among others) have been pushed to Solr.

But then none of my JCR-SQL2 / XPath queries work as they should.
To begin with, querying for nodes with non standard types fails with
"unknown node type".
I debugged that *NodeStateNodeTypeInfoProvider#types* contains none of my
custom types. Yet they do exist in "/jcr:system/jcr:nodeTypes/"!?

And should I do the simples query like "select * from [nt:base]", Oak then
logs the following:

> o.apache.jackrabbit.oak.query.QueryImpl  : Traversal query (query without
> index): select * from [nt:base]; consider creating an index
>
With a breakpoint in WhiteboardIndexProvider, I see that a
ComposeQueryIndexProvider exists with only 3 providers within:
ReferenceIndexProvider, PropertyIndexProvider and NodeTypeIndexProvider.
I suppose that's not correct — where's the SolrQueryIndexProvider?!

Thanks for your help.

-- 
Damiano Albani

Reply via email to