JCR OAK查询和节点类型

编程入门 行业动态 更新时间:2024-10-21 03:33:57
本文介绍了JCR OAK查询和节点类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在研究Apache JackRabbit OAK(1.3.2). 我已创建具有以下结构的节点(MyNode),并将其保存在存储库中. -'jcr:primaryType'=橡木:非结构化 -'name'='myNode' 我还根据文档. 但是,当我运行以下查询时,我没有任何结果. select * from [oak:Unstructured] where name='myNode' 当运行以下查询时,我得到保存的"MyNode"结果 '从[nt:base]中选择*,其中[jcr:primaryType] ='oak:Unstructured'和name ='myNode'

I am working on Apache JackRabbit OAK (1.3.2). I have created a node (MyNode) with the following structure and saved in the repository. -- 'jcr:primaryType'=oak:Unstructured -- 'name'='myNode' I also created a lucene index to index all the properties as per the documentation. However when i run the following query i get no results. select * from [oak:Unstructured] where name='myNode' And when the run the following query i get the saved 'MyNode' in result 'select * from [nt:base] where [jcr:primaryType]='oak:Unstructured' and name='myNode''

  • 当声明为nodeType时,为什么不能使用[oak:Unstructured]查询
  • 如何验证我是否能够利用创建的lucene索引?
  • 谢谢

    推荐答案

    当声明为nodeType时,为什么不能使用[oak:Unstructured]查询

    Why am i not able to query with [oak:Unstructured], when this is declared nodeType

    我无法查询的原因是在创建节点期间,仅将属性'jcr:primaryType'设置为'oak:Unstructured'是不够的.我们需要将该属性的类型显式设置为"NAME",否则将被视为"STRING"属性.

    The reason I was not able to query was during the creation of the node, just setting the property 'jcr:primaryType' to 'oak:Unstructured' is not enough. We need to set the type of this property to "NAME" explicitly, else it will be treated as a "STRING" property.

    如何验证我是否能够利用创建的lucene索引?

    How do i verify if i am able to leverage the lucene index created?

    仅创建索引节点将无法满足索引的需要,我们还需要使用索引来初始化存储库.我使用以下行在存储库中启用索引.

    Just creating the index node will not satisfy for indexing, we also need to initialize the repository with indexing. I used the following line to enable indexing in my repository.

    jcr.withAsyncIndexing();

    更多推荐

    JCR OAK查询和节点类型

    本文发布于:2023-10-26 23:38:26,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1531676.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:节点   类型   JCR   OAK

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!