Hello Ard, Bart,

Thanks for your help,

I added the property with type=int to indexer.xml, and after a resave of
the documents it now works as hoped for.
(and Ard, I indeed use the standard HippoSimpleXmlExtractor; together
with XPath, it is extremely powerful)

Thanks and regards,
Ewald

> Ard Schrijvers wrote:
> > Hello Ewald,
> >
> > lucene works purely alphabeticly, therefor, if you need to order on
> > numerical values, you can prepend the field with 0's.
> >
> > So, for example, you would get
> >
> > 0000000000002
> > 0000000000100
> >
> > Then, alphabetical ordering will go correct. The same holds for
range
> > queries.
> Isn't it also possible to set the type to 'int' in the
> (dasl-)indexer.xml? Like:
> 
>      <property namespace="DAV:" name="getcontentlength" type="int"/>
> 
> IIRC that should automagically fix the leading zeros problem in
lucene.
> Right?
> 
> Regards,
> Bart
> 
> 
> >
> > Regards Ard
> >
> >> Hello,
> >>
> >> I have a problem with sorting a DASL query on an metadata
> >> field that I obtained by an extractor. The intention is that
> >> the extractor calculates a numeric value, and then the
> >> d:orderby should order on that value.
> >> However, I end up with a alphabetic ordering instead of a
> >> numeric one (with ascending, I get 100 before 2). What do I
> >> need to do to use a numeric sorting (to evaluate the values
> >> as numbers?)
> >>
> >> The relevant code in my extractor looks like:
> >>
> >> <instruction property="courseDuration"
> >> namespace="http://hippo.nl/cms/1.0";
> >> xpath="/document/content/data/opleiding.duur*365"/>
> >>
> >> And in my DASL Query:
> >>
> >> <d:orderby>
> >>   <d:order>
> >>     <d:prop>
> >>       <h:courseDuration/>
> >>     </d:prop>
> >>     <d:ascending/>
> >>   </d:order>
> >> </d:orderby>
> >>
> >> Thanks for your help,
> >>
> >> Ewald
> >>
> >> ********************************************
> >> Hippocms-dev: Hippo CMS development public mailinglist
> >>
> > ********************************************
> > Hippocms-dev: Hippo CMS development public mailinglist
> 
> 
> --
> Hippo B.V.  -  Amsterdam
> Oosteinde 11, 1017 WT, Amsterdam, +31(0)20-5224466
> 
> Hippo USA Inc.  -  San Francisco
> 101 H Street, Suite Q, Petaluma CA, 94952-3329, +1 (707) 773-4646
> -----------------------------------------------------------------
> http://www.onehippo.com   -  [EMAIL PROTECTED]
> -----------------------------------------------------------------
> ********************************************
> Hippocms-dev: Hippo CMS development public mailinglist
********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Reply via email to