Page MenuHomePhabricator

Distorted results for comparator queries using < and > on pages with a custom {{DEFAULTSORT: }}
Closed, InvalidPublic

Description

Hi Markus,

there is a problem in getting the rigth ask query results with pages that have a {{DEFAULTSORT: ...}}, especially with the SMW comparator syntax, let’s say, [[pagename::<searched page name]]. If there is no {{DEFAULTSORT: ...}} on those pages, the results are all fine. See example 1 of our wiki. In example 2 with a {{DEFAULTSORT: word-2, word-1}} results are messed up or some pages that should be fetched, are missing. Is there any possibility to fix this odd sorting, or at least to verify this error? Is there a wiki to test this too, placing some {{DEFAULTSORT: word-2, word-1}} on pages, http://sandbox.semantic-mediawiki.org?

We are using SMW r82579 together with MediaWiki r79596.

I hope it can be fixed, because with this comparator query we construct an auto navigation, which at the moment does not work (all the bumblebee pages for Bombus on our wiki)

Kind regards
Andreas

Example 1 searches for [[Kategorie:Literatur]][[Seitenname::<Curtis J. 1838]] and gets the right pages:
Adolphi 1995, Angermann et al. 1995, Arnold & Ovenden 2004, Benton 2000, Benton 2006, Buchenau 1936, Buttler et al. 2010, Bährmann 1995, Bährmann 2008, Chinery 1993, Christensen 2005, Curtis J. 1838
http://offene-naturfuehrer.de/web/Spezial:Semantische_Suche?title=Spezial%3ASemantische+Suche&q=%5B%5BKategorie%3ALiteratur%5D%5D%5B%5BSeitenname%3A%3A%3CCurtis+J.+1838%5D%5D&po=&sort_num=&order_num=ASC&eq=yes&p%5Bformat%5D=list&p%5Blimit%5D=20&p%5Bheaders%5D=&p%5Bmainlabel%5D=&p%5Blink%5D=&p%5Bintro%5D=&p%5Boutro%5D=&p%5Bdefault%5D=&p%5Bsep%5D=&p%5Btemplate%5D=&p%5Buserparam%5D=&p%5Bintrotemplate%5D=&p%5Boutrotemplate%5D=&eq=yes&uselang=en

Example 2:
All Bombus pages have a {{DEFAULTSORT: ...}} with “word-2, word-1” (like “campestris, Bombus” etc.). The query [[Kategorie:Bombus – Hummeln]][[Seitenname::<Bombus vestalis]] just fetches "Bombus barbutellus". I wonder, where are the other pages in-between (Bombus barbutellus, Bombus campestris, Bombus hortorum, ...)?
http://offene-naturfuehrer.de/web/Spezial:Semantische_Suche?title=Spezial%3ASemantische+Suche&q=%5B%5BKategorie%3ABombus+%E2%80%93+Hummeln%5D%5D%5B%5BSeitenname%3A%3A%3CBombus+campestris%5D%5D&po=&sort_num=&order_num=ASC&eq=yes&p%5Bformat%5D=list&p%5Blimit%5D=20&p%5Bheaders%5D=&p%5Bmainlabel%5D=&p%5Blink%5D=&p%5Bintro%5D=&p%5Boutro%5D=&p%5Bdefault%5D=&p%5Bsep%5D=&p%5Btemplate%5D=&p%5Buserparam%5D=&p%5Bintrotemplate%5D=&p%5Boutrotemplate%5D=&eq=yes&uselang=en


Version: unspecified
Severity: critical
URL: http://offene-naturfuehrer.de

Details

Reference
bz28311

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:25 PM
bzimport set Reference to bz28311.

String-based searches on page-type properties always refer to the sortkey. This is intentional. So in your case, the query item [[Seitenname::<Bombus vestalis]] compares the string "Bombus vestalis" with your chosen sortkey "vestalis, Bombus". This explains why only "barbutellus, Bombus" is matching. There is no error here, just some confusion.

You may want to reconsider (a) if the sortkey is the right property for searching what you want here, and (b) if the sortkey is actually a good choice. I tried to find "Bombus vestalis" in the list of values on the page "Attribut:Seitenname" and found this very unintuitive (you may want to try it; it is really there!). So it seems that the current sortkey creates confusion in sorting and searching alike.

If you really want the sortkey to be as it is, you can always add a string property with the real pagename as its value instead. Maybe this was your intention with "Seitenname" -- as the name suggests.