You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by khaled tlili <kh...@gmail.com> on 2009/10/16 12:15:26 UTC

FullTextSeach, node and subnode

Hi,

In the jackrappib api (i.e
http://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/core/query/jsr283/qom/FullTextSearch.html),
it's  written that:

"The full-text search expression is evaluated against the set of full-text
indexed properties within the full-text search scope. If property is
specified, the full-text search scope is the property of that name on the
selector node in the node-tuple; otherwise the full-text search scope is all
properties of the selector node (*or, in some implementations, all
properties in the node subtree*)."

In the jackrabbit implementation, does the implementation of the full-text
search look into all the subtree properties? If not, how can I "force" the
full-text search to look into all properties of node subtree ?

I need this feature to make queries like  " select * from jnt:article  as a
where contain(a.*, 'toto -titi') "

Example:
Suupose that we have the following nodes structure:
[jnt:paragraph] > ...
bigText         insertText


[jnt:article] > ...
smallText       title
bigText         intro
+ * (jnt:paragraph)

What would be the SQL-2 query that allows to retrieve all articles that
contain "toto" but not "titi" ( = "titi" not present in all paragraph of the
arcticle) ?

Regards.
KT

Re: FullTextSeach, node and subnode

Posted by Benjamin Papez <ja...@gmail.com>.
Hello,

indeed I was able to make the article example (search on paragraph nodes and
used "toto -titi") work with using index aggregates.

But unfortunately it does not work with the "multi language" model we have
chosen, because each node also stores multilingual properties in a subnode,
so we do not only have subnodes like:

article/paragraph/subparagraph

but on each level, we also have translation subnodes for different languages

article/translation
article/paragraph/translation
article/paragraph/subparagraph/translation

So what we would really need is:

aggregating article/paragraph and article/paragraph/subparagraph into
article
and
aggregating article/paragraph/translation and
article/paragraph/subparagraph/translation into article/translation

Do you think that this could easily be solved (perhaps with a patch) or is
it too difficult to do ?

Regards,
Benjamin

2009/10/19 khaled tlili <kh...@gmail.com>

> Hi,
>
> Thanks 4 your answer.
>
> If I understand well, If I add :
>
> <aggregate primaryType="jnt:article">
>        <include>*</include>
>        <include>*/*</include>
>        <include>*/*/*</include>
>        <include>*/*/*/*</include>
>    </aggregate>
>
> in the indexing configuration file, the following SQL-2 query
>
> select * from jnt:article  as a where contain(a.*, 'toto -titi')
>
>  would search even on children of jnt:article ?
>
> Regards.
>
> KT.
>
> On Fri, Oct 16, 2009 at 1:06 PM, Ard Schrijvers
> <a....@onehippo.com>wrote:
>
> > You can achieve this with indexing aggregate
> >
> > http://wiki.apache.org/jackrabbit/IndexingConfiguration
> >
> > Regards Ard
> >
> > On Fri, Oct 16, 2009 at 12:15 PM, khaled tlili <kh...@gmail.com>
> > wrote:
> > > Hi,
> > >
> > > In the jackrappib api (i.e
> > >
> >
> http://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/core/query/jsr283/qom/FullTextSearch.html
> > ),
> > > it's  written that:
> > >
> > > "The full-text search expression is evaluated against the set of
> > full-text
> > > indexed properties within the full-text search scope. If property is
> > > specified, the full-text search scope is the property of that name on
> the
> > > selector node in the node-tuple; otherwise the full-text search scope
> is
> > all
> > > properties of the selector node (*or, in some implementations, all
> > > properties in the node subtree*)."
> > >
> > > In the jackrabbit implementation, does the implementation of the
> > full-text
> > > search look into all the subtree properties? If not, how can I "force"
> > the
> > > full-text search to look into all properties of node subtree ?
> > >
> > > I need this feature to make queries like  " select * from jnt:article
>  as
> > a
> > > where contain(a.*, 'toto -titi') "
> > >
> > > Example:
> > > Suupose that we have the following nodes structure:
> > > [jnt:paragraph] > ...
> > > bigText         insertText
> > >
> > >
> > > [jnt:article] > ...
> > > smallText       title
> > > bigText         intro
> > > + * (jnt:paragraph)
> > >
> > > What would be the SQL-2 query that allows to retrieve all articles that
> > > contain "toto" but not "titi" ( = "titi" not present in all paragraph
> of
> > the
> > > arcticle) ?
> > >
> > > Regards.
> > > KT
> > >
> >
>

Re: FullTextSeach, node and subnode

Posted by khaled tlili <kh...@gmail.com>.
Hi,

Thanks 4 your answer.

If I understand well, If I add :

<aggregate primaryType="jnt:article">
        <include>*</include>
        <include>*/*</include>
        <include>*/*/*</include>
        <include>*/*/*/*</include>
    </aggregate>

in the indexing configuration file, the following SQL-2 query

select * from jnt:article  as a where contain(a.*, 'toto -titi')

 would search even on children of jnt:article ?

Regards.

KT.

On Fri, Oct 16, 2009 at 1:06 PM, Ard Schrijvers
<a....@onehippo.com>wrote:

> You can achieve this with indexing aggregate
>
> http://wiki.apache.org/jackrabbit/IndexingConfiguration
>
> Regards Ard
>
> On Fri, Oct 16, 2009 at 12:15 PM, khaled tlili <kh...@gmail.com>
> wrote:
> > Hi,
> >
> > In the jackrappib api (i.e
> >
> http://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/core/query/jsr283/qom/FullTextSearch.html
> ),
> > it's  written that:
> >
> > "The full-text search expression is evaluated against the set of
> full-text
> > indexed properties within the full-text search scope. If property is
> > specified, the full-text search scope is the property of that name on the
> > selector node in the node-tuple; otherwise the full-text search scope is
> all
> > properties of the selector node (*or, in some implementations, all
> > properties in the node subtree*)."
> >
> > In the jackrabbit implementation, does the implementation of the
> full-text
> > search look into all the subtree properties? If not, how can I "force"
> the
> > full-text search to look into all properties of node subtree ?
> >
> > I need this feature to make queries like  " select * from jnt:article  as
> a
> > where contain(a.*, 'toto -titi') "
> >
> > Example:
> > Suupose that we have the following nodes structure:
> > [jnt:paragraph] > ...
> > bigText         insertText
> >
> >
> > [jnt:article] > ...
> > smallText       title
> > bigText         intro
> > + * (jnt:paragraph)
> >
> > What would be the SQL-2 query that allows to retrieve all articles that
> > contain "toto" but not "titi" ( = "titi" not present in all paragraph of
> the
> > arcticle) ?
> >
> > Regards.
> > KT
> >
>

Re: FullTextSeach, node and subnode

Posted by Ard Schrijvers <a....@onehippo.com>.
You can achieve this with indexing aggregate

http://wiki.apache.org/jackrabbit/IndexingConfiguration

Regards Ard

On Fri, Oct 16, 2009 at 12:15 PM, khaled tlili <kh...@gmail.com> wrote:
> Hi,
>
> In the jackrappib api (i.e
> http://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/core/query/jsr283/qom/FullTextSearch.html),
> it's  written that:
>
> "The full-text search expression is evaluated against the set of full-text
> indexed properties within the full-text search scope. If property is
> specified, the full-text search scope is the property of that name on the
> selector node in the node-tuple; otherwise the full-text search scope is all
> properties of the selector node (*or, in some implementations, all
> properties in the node subtree*)."
>
> In the jackrabbit implementation, does the implementation of the full-text
> search look into all the subtree properties? If not, how can I "force" the
> full-text search to look into all properties of node subtree ?
>
> I need this feature to make queries like  " select * from jnt:article  as a
> where contain(a.*, 'toto -titi') "
>
> Example:
> Suupose that we have the following nodes structure:
> [jnt:paragraph] > ...
> bigText         insertText
>
>
> [jnt:article] > ...
> smallText       title
> bigText         intro
> + * (jnt:paragraph)
>
> What would be the SQL-2 query that allows to retrieve all articles that
> contain "toto" but not "titi" ( = "titi" not present in all paragraph of the
> arcticle) ?
>
> Regards.
> KT
>