Relationship between IndexConfiguration and XPATH Search Queries

3 messages Options
Embed this post
Permalink
pkrishnaswami

Relationship between IndexConfiguration and XPATH Search Queries

Reply Threaded More More options
Print post
Permalink
I am trying to determine the relationship between using indexConfiguration file (to support custom indexing) and trying to retrieve items using XPATH that uses attributes that is not defined in the indexConfiguration file.

Our thinking  is, XPATH queries should only contain attributes that are being indexed? Only then will search return results.  Is our thinking correct?

We have an index configuration file that indexes on attributes A, B, C, D of a custom defined node. This node also has other attributes E, F and G. When we make a call to retrieve items from the repository, sometimes we build an XPATH using attributes E, F,G exclusively.

We expected the retrieve call to fail. On the contrary, results come back.

Can someone clarify if our assumption about indexConfiguration file and XPATH correct?


Alexander Klimetschek

Re: Relationship between IndexConfiguration and XPATH Search Queries

Reply Threaded More More options
Print post
Permalink
On Wed, Oct 28, 2009 at 16:33, pkrishna <[hidden email]> wrote:
> I am trying to determine the relationship between using indexConfiguration
> file (to support custom indexing) and trying to retrieve items using XPATH
> that uses attributes that is not defined in the indexConfiguration file.
>
> Our thinking  is, XPATH queries should only contain attributes that are
> being indexed? Only then will search return results.  Is our thinking
> correct?

No, by default all properties are indexed. The indexing configuration
is only there to define aggregates and other things for special
nodetypes. Because JCR is all about unstructured data (nt:unstructured
or residual property/child node definitions), the indexing does not
need to be instructed about what to be indexed.

Regards,
Alex

--
Alexander Klimetschek
[hidden email]
Marcel Reutegger

Re: Relationship between IndexConfiguration and XPATH Search Queries

Reply Threaded More More options
Print post
Permalink
In reply to this post by pkrishnaswami
Hi,

On Wed, Oct 28, 2009 at 16:33, pkrishna <[hidden email]> wrote:
>
> I am trying to determine the relationship between using indexConfiguration
> file (to support custom indexing) and trying to retrieve items using XPATH
> that uses attributes that is not defined in the indexConfiguration file.
>
> Our thinking  is, XPATH queries should only contain attributes that are
> being indexed? Only then will search return results.  Is our thinking
> correct?

that's correct if you have an indexing configuration that covers the
node types an properties used in your query.

in absence of an indexing configuration, everything is indexed.

if there is no matching index-rule for a given property, then all
properties of that node are indexed.

> We have an index configuration file that indexes on attributes A, B, C, D of
> a custom defined node. This node also has other attributes E, F and G. When
> we make a call to retrieve items from the repository, sometimes we build an
> XPATH using attributes E, F,G exclusively.
>
> We expected the retrieve call to fail. On the contrary, results come back.
>
> Can someone clarify if our assumption about indexConfiguration file and
> XPATH correct?

some random thoughts:

maybe the indexing configuration is not used. make sure you configured
the workspace correctly and check the logs for errors. If the indexing
configuration is invalid then it is simply ignored and an error is
logged. the repository will still start up.

after changing the indexing configuration you need to re-index the workspace.

you might get results with nodes that are not covered by your
index-rule. e.g. there are node of a type not covered by your indexing
configuration with properties E, F, G

regards
 marcel