jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vishal Seth <visha...@mastek.com>
Subject How do I configure Index Rules when using OCM
Date Wed, 28 Jan 2009 06:20:46 GMT
Hi,

I am trying to configure the index rules for jackrabbit where I am using OCM to persist my
data.

My understanding so far is that JackRabbit would index everything unless we specify specific
rules as part of index configuration. I need specific indexes to improve the start time for
a repository.

Once I define the index rules I am unable to retrieve the data.

I am attaching code snippets for index rule, jcrmapping & extracted log statements from
the query execution part.

Let me know if I am missing something or is there a different way of defining index when using
OCM? Is there a separate test case for the same?

In case any additional information is needed related to this then let me know.

Path for storing all the objects is "/rules/metadata"

Index rule configuration for properties is as follows:
  <index-rule nodeType="nt:unstructured">
     <property>id</property>
  </index-rule>
  <index-rule nodeType="nt:unstructured">
     <property>name</property>
  </index-rule>
  <index-rule nodeType="nt:unstructured">
     <property>className</property>
  </index-rule>
  <index-rule nodeType="nt:unstructured">
     <property>path</property>
  </index-rule>

Jcr mapping is as follows:
<class-descriptor className="com.test.TestVO" jcrType="nt:unstructured" >
          <field-descriptor fieldName="id" jcrName="id" id="true" />
          <field-descriptor fieldName="name"  jcrName="name"  />
          <field-descriptor fieldName="path"  path="true" />
<field-descriptor fieldName="prop1"  jcrName="prop1"  />
<field-descriptor fieldName="prop2"  jcrName="prop2"  />
<field-descriptor fieldName="prop3"  jcrName="prop3"  />
<field-descriptor fieldName="prop4"  jcrName="prop4"  />
</class-descriptor>

Relevant log statements from log file

2009-01-28 11:27:23,446|DEBUG|main|org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl|/jcr:root/rules/element(metadata,
nt:unstructured) [@ocm_classname='com.test.TestVO']
2009-01-28 11:27:23,446|DEBUG|main|org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl|Get
Objects with expression : /jcr:root/rules/element(metadata, nt:unstructured) [@ocm_classname='com.test.TestVO']
and language xpath
2009-01-28 11:27:23,446|DEBUG|main|org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl|Get
Node Iterator with expression /jcr:root/rules/element(metadata, nt:unstructured) [@ocm_classname='com.test.TestVO']
and language xpath
2009-01-28 11:27:23,446|DEBUG|main|org.apache.jackrabbit.core.query.lucene.QueryImpl|Executing
query:
+ Root node
+ Select properties: *
  + PathQueryNode
    + LocationStepQueryNode:  NodeTest={} Descendants=false Index=NONE
    + LocationStepQueryNode:  NodeTest={}rules Descendants=false Index=NONE
    + LocationStepQueryNode:  NodeTest={}metadata Descendants=false Index=NONE
      + NodeTypeQueryNode:  Prop={http://www.jcp.org/jcr/1.0}primaryType Value={http://www.jcp.org/jcr/nt/1.0}unstructured
      + RelationQueryNode: Op: = Prop=@{}ocm_classname Type=STRING Value=com.test.TestVO


2009-01-28 11:27:23,446|DEBUG|main|org.apache.jackrabbit.core.query.lucene.LuceneQueryBuilder|Coerced
com.test.TestVO into NAME.
2009-01-28 11:27:23,446|DEBUG|main|org.apache.jackrabbit.core.query.lucene.QueryResultImpl|getResults(2147483647)
limit=0
2009-01-28 11:27:23,462|DEBUG|main|org.apache.jackrabbit.core.query.lucene.QueryResultImpl|query
executed in 16 ms
2009-01-28 11:27:23,462|DEBUG|main|org.apache.jackrabbit.core.query.lucene.QueryResultImpl|retrieved
ScoreNodes in 0 ms

Regards,
Vishal
MASTEK LTD.
Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited,
unless specifically indicated to that effect. Mastek Limited does not accept any responsibility
or liability for it. This e-mail and attachments (if any) transmitted with it are confidential
and/or privileged and solely for the use of the intended person or entity to which it is addressed.
Any review, re-transmission, dissemination or other use of or taking of any action in reliance
upon this information by persons or entities other than the intended recipient is prohibited.
This e-mail and its attachments have been scanned for the presence of computer viruses. It
is the responsibility of the recipient to run the virus check on e-mails and attachments before
opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop
and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message