You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by pkrishna <pr...@ge.com> on 2009/10/28 16:33:58 UTC

Relationship between IndexConfiguration and XPATH Search Queries

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?



-- 
View this message in context: http://www.nabble.com/Relationship-between-IndexConfiguration-and-XPATH-Search-Queries-tp26096805p26096805.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Relationship between IndexConfiguration and XPATH Search Queries

Posted by Marcel Reutegger <ma...@gmx.net>.
Hi,

On Wed, Oct 28, 2009 at 16:33, pkrishna <pr...@ge.com> 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

Re: Relationship between IndexConfiguration and XPATH Search Queries

Posted by Alexander Klimetschek <ak...@day.com>.
On Wed, Oct 28, 2009 at 16:33, pkrishna <pr...@ge.com> 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
alexander.klimetschek@day.com