question about queries and facets

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

question about queries and facets

Jettro Coenradie
question about queries and facets

Hi All,
I am trying to query for nodes of the type myns:product that have been published. I am using the the facetselect to create a node live and a node preview under the root:

I create the live node with the following node definition

<?xml version="1.0" encoding="UTF-8"?>
<sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:rep="internal" xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:hippo="http://www.hippoecm.org/nt/1.2"
  sv:name="live">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
    <sv:value>nt:unstructured</sv:value>
  </sv:property>
  <sv:node sv:name="content">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>hippo:facetselect</sv:value>
    </sv:property>
    <sv:property sv:name="hippo:docbase" sv:type="String">
      <sv:value>ac4b47d2-bb4a-42c8-8341-58bc4cbad714</sv:value>
    </sv:property>
    <sv:property sv:name="hippo:facets" sv:type="String">
      <sv:value>hippostd:state</sv:value>
    </sv:property>
    <sv:property sv:name="hippo:values" sv:type="String">
      <sv:value>published</sv:value>
    </sv:property>
    <sv:property sv:name="hippo:modes" sv:type="String">
      <sv:value>single</sv:value>
    </sv:property>
  </sv:node>
</sv:node>

I am doing a query like this
//element(*,hpp:wastafel)

How can I differentiate between the live and preview environment?

If anybody has an idea, I would be very pleased :-)

thanks
Jettro


_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html
Reply | Threaded
Open this post in threaded view
|

Re: question about queries and facets

Jeroen Reijn
Administrator
This post has NOT been accepted by the mailing list yet.
Hi Jettro,

it can be achieved in two ways:

1. By filtering on the hippostd:state property with the value: ''unpublished"
2. By providing a path to the query, which you are performing.

Regards,

Jeroen

Jettro Coenradie wrote
Hi All,
I am trying to query for nodes of the type myns:product that have been published. I am using the the facetselect to create a node live and a node preview under the root:

I create the live node with the following node definition

<?xml version="1.0" encoding="UTF-8"?>
<sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:rep="internal" xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:hippo="http://www.hippoecm.org/nt/1.2"
  sv:name="live">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
    <sv:value>nt:unstructured</sv:value>
  </sv:property>
  <sv:node sv:name="content">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>hippo:facetselect</sv:value>
    </sv:property>
    <sv:property sv:name="hippo:docbase" sv:type="String">
      <sv:value>ac4b47d2-bb4a-42c8-8341-58bc4cbad714</sv:value>
    </sv:property>
    <sv:property sv:name="hippo:facets" sv:type="String">
      <sv:value>hippostd:state</sv:value>
    </sv:property>
    <sv:property sv:name="hippo:values" sv:type="String">
      <sv:value>published</sv:value>
    </sv:property>
    <sv:property sv:name="hippo:modes" sv:type="String">
      <sv:value>single</sv:value>
    </sv:property>
  </sv:node>
</sv:node>

I am doing a query like this
//element(*,hpp:wastafel)

How can I differentiate between the live and preview environment?

If anybody has an idea, I would be very pleased :-)

thanks
Jettro

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html
Ard
Reply | Threaded
Open this post in threaded view
|

Re: question about queries and facets

Ard
In reply to this post by Jettro Coenradie
Hello Jettro,

On Wed, Feb 18, 2009 at 3:21 PM, Jettro Coenradie <[hidden email]> wrote:

> Hi All,
> I am trying to query for nodes of the type myns:product that have been
> published. I am using the the facetselect to create a node live and a node
> preview under the root:
>
> I create the live node with the following node definition
>
> <?xml version="1.0" encoding="UTF-8"?>
> <sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:rep="internal"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>   xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
> xmlns:hippo="http://www.hippoecm.org/nt/1.2"
>   sv:name="live">
>   <sv:property sv:name="jcr:primaryType" sv:type="Name">
>     <sv:value>nt:unstructured</sv:value>
>   </sv:property>
>   <sv:node sv:name="content">
>     <sv:property sv:name="jcr:primaryType" sv:type="Name">
>       <sv:value>hippo:facetselect</sv:value>
>     </sv:property>
>     <sv:property sv:name="hippo:docbase" sv:type="String">
>       <sv:value>ac4b47d2-bb4a-42c8-8341-58bc4cbad714</sv:value>
>     </sv:property>
>     <sv:property sv:name="hippo:facets" sv:type="String">
>       <sv:value>hippostd:state</sv:value>
>     </sv:property>
>     <sv:property sv:name="hippo:values" sv:type="String">
>       <sv:value>published</sv:value>
>     </sv:property>
>     <sv:property sv:name="hippo:modes" sv:type="String">
>       <sv:value>single</sv:value>
>     </sv:property>
>   </sv:node>
> </sv:node>
>
> I am doing a query like this
> //element(*,hpp:wastafel)
>
> How can I differentiate between the live and preview environment?

Querying is done against the physical content only. We still are
braining how to facilitate best querying in virtual tree. The hardest
part of it, is that we have to leverage it jcr compliant.

For now, we work around it from the frontend (also, I have to admit it
is not how we want it in the end, because it assumes some workflow
knowledge about which properties are set, which, obviously, it should
not rely on).

Basically,  how i did it for the hst 2 at [1]. There you will find a
ContextWhereClause class that computes for you an xpath where clause
that contains all the Filters applied (if you have multiple filters,
you'll get extra where clauses). Also a virtual 'target' path is
translated to a where clause containing something like :
hippo:paths=someUuid. This is IMO to prefer above path constraint
searches anyway, because they are terribly slow.

The weakest point of the current ContextWhereClause is the part at
line 138, [if ("hippostd:state".equals(facet) &&
"unpublished".equals(value)) ]

There i have to have workflow knowledge. The difficulty with it, is
because, if you want to search in 'preview', you only want

1) hits of documents that are 'preview'

AND

2) hits of documents that are 'live' but have no preview.

This is because when a preview is published, there is not preview anymore.

Anyway, it works for the rest really fine, queries are blistering fast
if you compare it to some basic queries in Jackrabbit, but it is not
entirely worked out yet. Obviously, transparently featuring it from
within the repository is of course the nicest solution, but hopefully
you can get started with the one depicted here,

Regards Ard

[1] https://svn.hippocms.org/repos/hippo/ecm/site-toolkit/trunk/core/src/main/java/org/hippoecm/hst/core/template/module/query/ContextWhereClause.java

>
> If anybody has an idea, I would be very pleased :-)
>
> thanks
> Jettro
>
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/community.html
>
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html
Ard
Reply | Threaded
Open this post in threaded view
|

Re: question about queries and facets

Ard
In reply to this post by Jeroen Reijn
On Wed, Feb 18, 2009 at 4:23 PM, Jeroen Reijn <[hidden email]> wrote:
>
> Hi Jettro,
>
> it can be achieved in two ways:
>
> 1. By filtering on the hippostd:state property with the value:
> ''unpublished"

This returns you not the nodes that are published but do not have an
unpublished, which you typically would like to see

> 2. By providing a path to the query, which you are performing.

Because unpublished and published documents both live under the
umbrella of a handle in the physical structure, a path won't be able
to help you out here. Path queries in Jackrabbit are IMO also not
performing like they should. Therefor we have added hippo:paths
properties you can query on: basically they represent a path, but are
indexed as single terms in lucene, hence can be search for really fast
and scalable, as path queries by default are not

Regards Ard

>
> Regards,
>
> Jeroen
>
>
> Jettro Coenradie wrote:
>>
>> Hi All,
>> I am trying to query for nodes of the type myns:product that have been
>> published. I am using the the facetselect to create a node live and a node
>> preview under the root:
>>
>> I create the live node with the following node definition
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:rep="internal"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>   xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
>> xmlns:hippo="http://www.hippoecm.org/nt/1.2"
>>   sv:name="live">
>>   <sv:property sv:name="jcr:primaryType" sv:type="Name">
>>     <sv:value>nt:unstructured</sv:value>
>>   </sv:property>
>>   <sv:node sv:name="content">
>>     <sv:property sv:name="jcr:primaryType" sv:type="Name">
>>       <sv:value>hippo:facetselect</sv:value>
>>     </sv:property>
>>     <sv:property sv:name="hippo:docbase" sv:type="String">
>>       <sv:value>ac4b47d2-bb4a-42c8-8341-58bc4cbad714</sv:value>
>>     </sv:property>
>>     <sv:property sv:name="hippo:facets" sv:type="String">
>>       <sv:value>hippostd:state</sv:value>
>>     </sv:property>
>>     <sv:property sv:name="hippo:values" sv:type="String">
>>       <sv:value>published</sv:value>
>>     </sv:property>
>>     <sv:property sv:name="hippo:modes" sv:type="String">
>>       <sv:value>single</sv:value>
>>     </sv:property>
>>   </sv:node>
>> </sv:node>
>>
>> I am doing a query like this
>> //element(*,hpp:wastafel)
>>
>> How can I differentiate between the live and preview environment?
>>
>> If anybody has an idea, I would be very pleased :-)
>>
>> thanks
>> Jettro
>>
>> _______________________________________________
>> Hippo-cms7-user mailing list and forums
>> http://www.onehippo.org/cms7/support/community.html
>>
>
>
> -----
> http://blogs.hippo.nl/reijn/
> --
> View this message in context: http://n2.nabble.com/question-about-queries-and-facets-tp2347068p2347426.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
>
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/community.html
>
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html
Reply | Threaded
Open this post in threaded view
|

Re: question about queries and facets

Jeroen Reijn-2
Ard,

thanks for your clarification.

Regards,

Jeroen

Ard Schrijvers wrote:

> On Wed, Feb 18, 2009 at 4:23 PM, Jeroen Reijn <[hidden email]> wrote:
>> Hi Jettro,
>>
>> it can be achieved in two ways:
>>
>> 1. By filtering on the hippostd:state property with the value:
>> ''unpublished"
>
> This returns you not the nodes that are published but do not have an
> unpublished, which you typically would like to see
>
>> 2. By providing a path to the query, which you are performing.
>
> Because unpublished and published documents both live under the
> umbrella of a handle in the physical structure, a path won't be able
> to help you out here. Path queries in Jackrabbit are IMO also not
> performing like they should. Therefor we have added hippo:paths
> properties you can query on: basically they represent a path, but are
> indexed as single terms in lucene, hence can be search for really fast
> and scalable, as path queries by default are not
>
> Regards Ard
>
>> Regards,
>>
>> Jeroen
>>
>>
>> Jettro Coenradie wrote:
>>> Hi All,
>>> I am trying to query for nodes of the type myns:product that have been
>>> published. I am using the the facetselect to create a node live and a node
>>> preview under the root:
>>>
>>> I create the live node with the following node definition
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:rep="internal"
>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>>   xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
>>> xmlns:hippo="http://www.hippoecm.org/nt/1.2"
>>>   sv:name="live">
>>>   <sv:property sv:name="jcr:primaryType" sv:type="Name">
>>>     <sv:value>nt:unstructured</sv:value>
>>>   </sv:property>
>>>   <sv:node sv:name="content">
>>>     <sv:property sv:name="jcr:primaryType" sv:type="Name">
>>>       <sv:value>hippo:facetselect</sv:value>
>>>     </sv:property>
>>>     <sv:property sv:name="hippo:docbase" sv:type="String">
>>>       <sv:value>ac4b47d2-bb4a-42c8-8341-58bc4cbad714</sv:value>
>>>     </sv:property>
>>>     <sv:property sv:name="hippo:facets" sv:type="String">
>>>       <sv:value>hippostd:state</sv:value>
>>>     </sv:property>
>>>     <sv:property sv:name="hippo:values" sv:type="String">
>>>       <sv:value>published</sv:value>
>>>     </sv:property>
>>>     <sv:property sv:name="hippo:modes" sv:type="String">
>>>       <sv:value>single</sv:value>
>>>     </sv:property>
>>>   </sv:node>
>>> </sv:node>
>>>
>>> I am doing a query like this
>>> //element(*,hpp:wastafel)
>>>
>>> How can I differentiate between the live and preview environment?
>>>
>>> If anybody has an idea, I would be very pleased :-)
>>>
>>> thanks
>>> Jettro
>>>
>>> _______________________________________________
>>> Hippo-cms7-user mailing list and forums
>>> http://www.onehippo.org/cms7/support/community.html
>>>
>>
>> -----
>> http://blogs.hippo.nl/reijn/
>> --
>> View this message in context: http://n2.nabble.com/question-about-queries-and-facets-tp2347068p2347426.html
>> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> Hippo-cms7-user mailing list and forums
>> http://www.onehippo.org/cms7/support/community.html
>>
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/community.html
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html
Reply | Threaded
Open this post in threaded view
|

RE: question about queries and facets

Jettro Coenradie
thanks guys, now I have homework for tonight :-)

greetz Jettro


-----Original Message-----
From: [hidden email] on behalf of Jeroen Reijn
Sent: Wed 2/18/2009 4:29 PM
To: Hippo CMS7 user list
Subject: Re: [Hippo-cms7-user] question about queries and facets
 
Ard,

thanks for your clarification.

Regards,

Jeroen

Ard Schrijvers wrote:

> On Wed, Feb 18, 2009 at 4:23 PM, Jeroen Reijn <[hidden email]> wrote:
>> Hi Jettro,
>>
>> it can be achieved in two ways:
>>
>> 1. By filtering on the hippostd:state property with the value:
>> ''unpublished"
>
> This returns you not the nodes that are published but do not have an
> unpublished, which you typically would like to see
>
>> 2. By providing a path to the query, which you are performing.
>
> Because unpublished and published documents both live under the
> umbrella of a handle in the physical structure, a path won't be able
> to help you out here. Path queries in Jackrabbit are IMO also not
> performing like they should. Therefor we have added hippo:paths
> properties you can query on: basically they represent a path, but are
> indexed as single terms in lucene, hence can be search for really fast
> and scalable, as path queries by default are not
>
> Regards Ard
>
>> Regards,
>>
>> Jeroen
>>
>>
>> Jettro Coenradie wrote:
>>> Hi All,
>>> I am trying to query for nodes of the type myns:product that have been
>>> published. I am using the the facetselect to create a node live and a node
>>> preview under the root:
>>>
>>> I create the live node with the following node definition
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:rep="internal"
>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>>   xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
>>> xmlns:hippo="http://www.hippoecm.org/nt/1.2"
>>>   sv:name="live">
>>>   <sv:property sv:name="jcr:primaryType" sv:type="Name">
>>>     <sv:value>nt:unstructured</sv:value>
>>>   </sv:property>
>>>   <sv:node sv:name="content">
>>>     <sv:property sv:name="jcr:primaryType" sv:type="Name">
>>>       <sv:value>hippo:facetselect</sv:value>
>>>     </sv:property>
>>>     <sv:property sv:name="hippo:docbase" sv:type="String">
>>>       <sv:value>ac4b47d2-bb4a-42c8-8341-58bc4cbad714</sv:value>
>>>     </sv:property>
>>>     <sv:property sv:name="hippo:facets" sv:type="String">
>>>       <sv:value>hippostd:state</sv:value>
>>>     </sv:property>
>>>     <sv:property sv:name="hippo:values" sv:type="String">
>>>       <sv:value>published</sv:value>
>>>     </sv:property>
>>>     <sv:property sv:name="hippo:modes" sv:type="String">
>>>       <sv:value>single</sv:value>
>>>     </sv:property>
>>>   </sv:node>
>>> </sv:node>
>>>
>>> I am doing a query like this
>>> //element(*,hpp:wastafel)
>>>
>>> How can I differentiate between the live and preview environment?
>>>
>>> If anybody has an idea, I would be very pleased :-)
>>>
>>> thanks
>>> Jettro
>>>
>>> _______________________________________________
>>> Hippo-cms7-user mailing list and forums
>>> http://www.onehippo.org/cms7/support/community.html
>>>
>>
>> -----
>> http://blogs.hippo.nl/reijn/
>> --
>> View this message in context: http://n2.nabble.com/question-about-queries-and-facets-tp2347068p2347426.html
>> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> Hippo-cms7-user mailing list and forums
>> http://www.onehippo.org/cms7/support/community.html
>>
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/community.html
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html


_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html

winmail.dat (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: question about queries and facets

Arje Cahn
Administrator
This post has NOT been accepted by the mailing list yet.

Jettro Coenradie wrote
thanks guys, now I have homework for tonight :-)
Now I'm curious. How did the homework go? :)

Arje
Reply | Threaded
Open this post in threaded view
|

RE: question about queries and facets

Jettro Coenradie
RE: [Hippo-cms7-user] question about queries and facets

Haha, very well. My team already took up the advice and implemented it, so I could play with my Playstation :-)


-----Original Message-----
From: [hidden email] on behalf of Arje Cahn
Sent: Fri 2/20/2009 10:34 AM
To: [hidden email]
Subject: RE: [Hippo-cms7-user] question about queries and facets




Jettro Coenradie wrote:
>
> thanks guys, now I have homework for tonight :-)
>

Now I'm curious. How did the homework go? :)

Arje
--
View this message in context: http://n2.nabble.com/question-about-queries-and-facets-tp2347068p2357929.html
Sent from the Hippo CMS 7 mailing list archive at Nabble.com.

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html


_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html
Reply | Threaded
Open this post in threaded view
|

RE: question about queries and facets

Arje Cahn
Administrator
This post has NOT been accepted by the mailing list yet.

Jettro Coenradie wrote
Haha, very well. My team already took up the advice and implemented it, so I could play with my Playstation :-)
What?! You had to play with the Playstation while they were having fun with facets???

That must've been a really frustrating evening :)

Arje
Ard
Reply | Threaded
Open this post in threaded view
|

Re: question about queries and facets

Ard
In reply to this post by Arje Cahn
>
> Jettro Coenradie wrote:
>>
>> thanks guys, now I have homework for tonight :-)
>>
>
> Now I'm curious. How did the homework go? :)

Without disencouraging you, i want you to know that the new hst2 will
have a similar ContextWhereClause 'computer', only by DI via Spring
such, if in case you have a completely different workflow which set
different states for example (instead of draft -> unpublished ->
published) you might have 'draft -> draft2 -> unpublished -> reviewed
-> published')

Hope to have this available end of next week

Ard

>
> Arje
> --
> View this message in context: http://n2.nabble.com/question-about-queries-and-facets-tp2347068p2357929.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
>
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/community.html
>
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/community.html