The pages - paragraph confusion: 

I am looking for pages (mgnl:content) and I want to exclude all pages having 
the page property (NodeData) notSearchable=true. 
But the content I am seaching is stored in paragraph childs (mgnl:contentNode 
and their NodeData) of these pages. All content is in paragraphs, not directly 
on the page.  

Thus 
SELECT * FROM mgnl:contentNode WHERE ... returns the required contentNodes or 
(if I choose mgnl:content as result item type) the pages. 

SELECT * FROM mgnl:content WHERE same condition...returns nothing because there 
is no page having the search terms whithin its page properties. 

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

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 helped myself by filtering the result list. Not nice and certainly a 
performance blocker on large search results but is works. 

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. 

Greetings
Wolf

 

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


Sorry to post again but I didn't see this mail in the mailing list, so I 
think it's either lost or I have a problem with mail server...


 > I tried the XPATH analog /jcr:root/content[1]//element(*, 
mgnl:contentNode)[jcr:contains(.,
 > 'something') and not(jcr:contains(@hideInNav, 'true'))] order by
 > @jcr:score descending
 > with the same result. At least this is fine :-)

If the property is stored as boolean the condition should be like this:

/jcr:root/content[1]//element(*, mgnl:content)[jcr:contains(.,
'something') and (not(@hideInNav) or (@hideInNav eq false()))] order by
@jcr:score descending

It seems really strange: the "not(@hideInNav)" means that the property 
should be null (for those pages without this property, if they should be 
shown), and the "eq false()" really needs the "()" after the false, they 
are part of the sintax, because this is a function that returns the 
false value.
Also I noticed that you wrote about "pages", but the original query was 
looking for paragraphs (mgnl:contentNode). Check what are you looking for...

 > 2) Can I exclude some paragraphs from beeing searched? How would such a
 > query string look like? Is there a better solution than providing (a
 > long) white list of node names to search in?

I think the query I wrote above should be right, but you should try 
adding one condition at time and see if everything is ok.

Greeting, 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