You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by hsp <pi...@ibest.com.br> on 2013/09/19 16:49:51 UTC

Searching by exclusions

I need to search for nodes that does not have a certain uuid value into a
multi-value property (or is empty).
I tried to do a expression like:

//element(*,nt:file)[ jcr:contains(@prop:group, '*   !
9ef90c86\-734a\-414e\-84c3\-64dc6452864c') ]

in a hope to get all nodes with that property with different values that
9ef90c86\-734a\-414e\-84c3\-64dc6452864c.
In the http://lucene.apache.org/core/2_9_4/queryparsersyntax.html
...
The NOT operator excludes documents that contain the term after NOT. This is
equivalent to a difference using sets. The symbol ! can be used in place of
the word NOT.

To search for documents that contain "jakarta apache" but not "Apache
Lucene" use the query:

"jakarta apache" NOT "Apache Lucene"

Note: The NOT operator cannot be used with just one term. For example, the
following search will return no results:

NOT "jakarta apache"
...

that's why I started the terms with a "*" term, don't know the side
effects...

Any help will be appreciated, 
Helio.



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Searching-by-exclusions-tp4659556.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Searching by exclusions

Posted by hsp <pi...@ibest.com.br>.
Justin, thanks by your post.

I did such search like you said, but it returns all nodes including the
nodes with that value in prop:group, may be because it is a multi-value
property.
Any other hint will be very appreciate, thanks!



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Searching-by-exclusions-tp4659556p4659558.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Searching by exclusions

Posted by Justin Edelson <ju...@justinedelson.com>.
Hi,
I think you want
//element(*,nt:file)[@prop:group != '9ef90c86-734a-414e-84c3-64dc6452864c']

You should be using the JCR specification as the point of reference. The
fact that Lucene is used is an implementation detail.

Regards,
Justin


On Thu, Sep 19, 2013 at 10:49 AM, hsp <pi...@ibest.com.br> wrote:

> I need to search for nodes that does not have a certain uuid value into a
> multi-value property (or is empty).
> I tried to do a expression like:
>
> //element(*,nt:file)[ jcr:contains(@prop:group, '*   !
> 9ef90c86\-734a\-414e\-84c3\-64dc6452864c') ]
>
> in a hope to get all nodes with that property with different values that
> 9ef90c86\-734a\-414e\-84c3\-64dc6452864c.
> In the http://lucene.apache.org/core/2_9_4/queryparsersyntax.html
> ...
> The NOT operator excludes documents that contain the term after NOT. This
> is
> equivalent to a difference using sets. The symbol ! can be used in place of
> the word NOT.
>
> To search for documents that contain "jakarta apache" but not "Apache
> Lucene" use the query:
>
> "jakarta apache" NOT "Apache Lucene"
>
> Note: The NOT operator cannot be used with just one term. For example, the
> following search will return no results:
>
> NOT "jakarta apache"
> ...
>
> that's why I started the terms with a "*" term, don't know the side
> effects...
>
> Any help will be appreciated,
> Helio.
>
>
>
> --
> View this message in context:
> http://jackrabbit.510166.n4.nabble.com/Searching-by-exclusions-tp4659556.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>