Hi Ard, We are using a custom DutchAccentlessAnalyzer for the caption, which is a wrapper around StandardAnalyzer that adds an accent remover and uses some stop words. That means that we can't use string indexing, right? If so, I think that Nick will probably have to do his own post-query sorting, or do you have a better solution?
However, I'm wondering why there is a difference in sorting ability between: <analyzer class="nl.hippo.slide.index.analysis.SimpleStandardAnalyzer"/> <property namespace="http://hippo.nl/cms/1.0" name="caption" type="string"/> and <property namespace="http://hippo.nl/cms/1.0" name="caption" type="text" analyzer="nl.hippo.slide.index.analysis.SimpleStandardAnalyzer"/> It seems to me that in both cases the same analyzer is used and the same sorting ability should be possible. Is there a hidden assumption that the default/string analyzer will return a single sortable value, while in the second case an array of values may be returned? Or perhaps using the String type results in a concatenation of the array values. Whatever the case may be, that is quite an ugly design, I think. Ideally, you would want the ability to define a comparator in the indexer.xml for a property, so every property can be sorted, in a flexible way. A simpler solution may be to treat text and string properties the same way when sorting. Is that a viable change or would it require changes to Lucene? Regards, Wouter On Thu, Feb 12, 2009 at 5:28 PM, Ard Schrijvers <[email protected]>wrote: > Hello Nick, > > Most likely you configured the h:caption to be text indexed > (indexer.xml). This means, you can not properly sort on it. If you index > it as String (this is default how properties are indexed), sorting will > be correct. If you are searching in captions like with > S:property-contains, you have to replace this with S:propsearch, see [1] > > If you are interested in the reasoning behind text/string indexing let > me know and I'll explain a litte more, > > Regards Ard > > [1] > http://wiki.hippo.nl/display/CMS/06.+Using+DASL+Queries#06.UsingDASLQuer > ies-%3CS%3A(not)propertycontains%2F%3E<http://wiki.hippo.nl/display/CMS/06.+Using+DASL+Queries#06.UsingDASLQuer%0Aies-%3CS%3A%28not%29propertycontains%2F%3E> > > > > > > I am executing a DASL query [1] against the repository 1.2.15 > > to select a number of results ordered by their caption. I get > > a number of results [2] which are wrongly ordered. I have > > tried to throw away the index at the repository and rebuild > > it, but that didn't help. What can cause this behavior? > > > > With regards, > > > > Nick Stolwijk > > ~Java Developer~ > > > > Iprofs BV. > > Claus Sluterweg 125 > > 2012 WS Haarlem > > www.iprofs.nl > > > > [1] > > <?xml version="1.0" encoding="utf-8" ?> > > <!-- productlist_dasl.ftl --> > > <d:searchrequest xmlns:s="http://jakarta.apache.org/slide/" > > xmlns:h="http://hippo.nl/cms/1.0" xmlns:d="DAV:"> > > <d:basicsearch> > > <d:select> > > <d:prop> > > <s:nrHits/> > > <d:displayname/> > > <h:caption /> > > > > </d:prop> > > </d:select> > > <d:from> > > <d:scope> > > <d:href>content</d:href> > > <d:depth>Infinity</d:depth> > > </d:scope> > > </d:from> > > > > <limit xmlns="DAV:"> > > <nresults>12</nresults> > > <offset > > xmlns="http://jakarta.apache.org/slide/">0</offset> > > </limit> > > > > <d:orderby> > > <d:order> > > <d:prop> > > <h:caption/> > > </d:prop> > > <d:ascending /> > > </d:order> > > </d:orderby> > > </d:basicsearch> > > </d:searchrequest> > > > > > > [2] > > > > <?xml version="1.0" encoding="UTF-8"?> > > <D:multistatus xmlns:D="DAV:"> > > <D:response> > > > > <D:href>/default/files/default.www/content/aaaa-buiten.xml</D:href> > > <D:propstat> > > <D:prop> > > <S:nrHits > > xmlns:S="http://jakarta.apache.org/slide/">4</S:nrHits> > > <D:displayname>aaaa-buiten.xml</D:displayname> > > <caption xmlns="http://hippo.nl/cms/1.0">AAAA > > - buiten</caption> > > </D:prop> > > <D:status>HTTP/1.1 200 OK</D:status> > > </D:propstat> > > </D:response> > > <D:response> > > > > <D:href>/default/files/default.www/content/dominicus.xml</D:href> > > <D:propstat> > > <D:prop> > > <S:nrHits > > xmlns:S="http://jakarta.apache.org/slide/">4</S:nrHits> > > > > <D:displayname>slovenie-istrie-rg-dominicus.xml</D:displayname> > > <caption > > xmlns="http://hippo.nl/cms/1.0">DOMINICUS</caption> > > </D:prop> > > <D:status>HTTP/1.1 200 OK</D:status> > > </D:propstat> > > </D:response> > > <D:response> > > > > <D:href>/default/files/default.www/content/appdata/webwinkel/c > > ategorien/reis-en-cadeauartikelen/reisartikelen/aaaa-leden.xml > > </D:href> > > <D:propstat> > > <D:prop> > > <S:nrHits > > xmlns:S="http://jakarta.apache.org/slide/">4</S:nrHits> > > > > <D:displayname>anwb-werelstekker-voordeel-voor-leden.xml</D:di > > splayname> > > <caption xmlns="http://hippo.nl/cms/1.0">AAAA > > leden</caption> > > </D:prop> > > <D:status>HTTP/1.1 200 OK</D:status> > > </D:propstat> > > </D:response> > > <D:response> > > > > <D:href>/default/files/default.www/content/zonnebril.xml</D:href> > > <D:propstat> > > <D:prop> > > <S:nrHits > > xmlns:S="http://jakarta.apache.org/slide/">4</S:nrHits> > > <D:displayname>zonnebril-202.xml</D:displayname> > > <caption > > xmlns="http://hippo.nl/cms/1.0">ZONNEBRIL 202</caption> > > </D:prop> > > <D:status>HTTP/1.1 200 OK</D:status> > > </D:propstat> > > </D:response> > > </D:multistatus> > > ******************************************** > > Hippocms-dev: Hippo CMS development public mailinglist > > > > Searchable archives can be found at: > > MarkMail: http://hippocms-dev.markmail.org > > Nabble: http://www.nabble.com/Hippo-CMS-f26633.html > > > > > ******************************************** > Hippocms-dev: Hippo CMS development public mailinglist > > Searchable archives can be found at: > MarkMail: http://hippocms-dev.markmail.org > Nabble: http://www.nabble.com/Hippo-CMS-f26633.html > > -- Met vriendelijke groet, Wouter Zelle ******************************************** Hippocms-dev: Hippo CMS development public mailinglist Searchable archives can be found at: MarkMail: http://hippocms-dev.markmail.org Nabble: http://www.nabble.com/Hippo-CMS-f26633.html
