Hello,

After having scratched my head for hours without success, I increased Oak's
logging verbosity and I could see an message about
*SolrQueryIndexProviderService* not being activated due to a missing
dependency on "nodeAggregator".
And indeed, manually registering a service implementing
*QueryIndex$NodeAggregator* made the difference: the Solr index gets used
for queries in my Spring / OSGi setup!
I don't know if I missed something obvious in the documentation but it has
taken me a while to find the solution.

Regards,

On Wed, Mar 13, 2019 at 12:08 AM Damiano Albani <[email protected]>
wrote:

> Hello again,
>
> Of course, it's only a matter of minutes after I sent my message that I
> figured out the reason of problem #1: I wasn't connected to the right
> repository. Doh!
> Calling *JcrUtils.getRepository(String uri)* with the wrong URI returned
> a new, empty Oak repository in memory apparently.
>
> Problem #2 is still a thing though: I don't see Solr being used for
> queries.
>
>> o.apache.jackrabbit.oak.query.QueryImpl  : Traversal query (query without
>> index): select * from [document:document] where contains([document:name],
>> 'e'); consider creating an index
>>
>
> Any idea what I'm doing wrong?
>
> On Tue, Mar 12, 2019 at 10:48 PM Damiano Albani <[email protected]>
> wrote:
>
>> 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
>>
>
>
> --
> Damiano Albani
>


-- 
Damiano Albani

Reply via email to