Hallo Danilo, 

Thanks for your nice XPATH query. I'll give it a try and get rid of my Filter 
preducates. I tried to translate it into SQL 
(http://people.apache.org/~mreutegg/jcr-query-translator/translator.html) but 
obviously this is not possible. XPATH support of JCR is more powerfull. 

However, for your problem with excluding several path segments of your content 
tree SQL may be a better choice. 
I use SELECT * FROM mgnl:contentNode WHERE .... AND jcr:path LIKE '/content/%' 
... To restrict search to a subtree. This may be easily changet to some 
excluding AND NOT clauses. But I'm afraid for other parts of your query you 
need XPATH. 

For the perfomance issue I'm not shure what will be faster: 
- repeating the query or
- process the full list on first result page
This depends on what will be faster: 
- reading all the content nodes from the repository (done for the query and 
getting the Content list)
- or prossessing the NodeDataValues to get the result snippets

Greetings 
Wolf

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] 
Im Auftrag von Danilo Ghirardelli
Gesendet: Mittwoch, 28. Januar 2009 23:52
An: Magnolia User-List
Betreff: Re: AW: [magnolia-user] Jcr queries: 2 questions on how to exclude 
nodes


> May be part of the confusion is that I am thinking in SQL and you talk about 
> XPATH.

Yes, I usually use xpath, but I noticed that sometimes it's impossible 
to obtain the query I want either way.

> Up to now I found no way to search for pages with a certain paragraph content 
> and use page properties to exclude single pages from beeing found. 

I don't know how to translate it in sql, but in xpath it is possible to 
split the query condition (works in magnolia 3.6.3, don't know in 
previous versions). You should then try something like this:

//element(*, mgnl:content)[not(@hide) or (@hide eq false())]//element(*, 
mgnl:contentNode)[jcr:contains(*, 'search')]

I use this in my own search as well, it looks only in paragraphs 
contained in pages without the given attribute.

> I helped myself by filtering the result list. Not nice and certainly a 
> performance blocker on large search results but is works. 

I have to do this anyway, and this is my problem: I have to exclude not 
only a few pages just like this but a few branches (configurable) so I 
have to post-process all the results and remove the unwanted result, 
because there isn't any "NOT IN" clause in xpath (and neither in the sql 
implementation of jackrabbit, as long as I know, but I'd love to be 
wrong in this case).

> By the way not the only perfomance blocker. Even if i have a paging for the 
> search results I have to process the complete list (extract handes, titles 
> and highlighted text snippets) if I do not want to repeat the search each 
> time I am stepping to the next page of results. This is because the jcr 
> session will be closed on the next page request. 

Why? If you page the list just extract the snippet in the page, at the 
next paging just redo the search and extract the snippet only for the 
pages/results shown.

For the hidden property, do as Ralf said, use defaultValue. Obviously 
you should save at least once the page dialog, for each page. Or add a 
startup task that populates the value for all the empty pages that 
should need it.

Regards, Danilo.

----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to