Hi all, 

I am trying to sort results based on multiple fields aliased as one. Is that 
possible? While solr does not complain (no error, results OK, etc etc etc) it 
fails to sort the hits appropriately. I've attached the query, relevant schema 
part and result. 

I am very curious to know if that is a feature that is currently supported 
(sorting on aliases)

Cheers, 

_Stephane

schema:
    <dynamicField name="*_sort" required="false" type="date" indexed="true" 
stored="true" multiValued="false"/>
    <field name="last_modified" type="date" indexed="true" stored="true" 
multiValued="false"/>
    <field name="modified" type="date" indexed="true" stored="true" 
multiValued="false"/>
   

query: 
http://localhost:8983/select?q.alt=*%3A*&q.op=OR&rows=10&start=0&qt=%2Fselect&q=&qf=title_search%5E1.0&pf=title_search%5E1.0&fl=last_modified%2Cmodified%2Cmodified_sort%3Alast_modified%2Cmodified_sort%3Amodified&debugOther=1&debug=1&debugQuery=true&sort=modified_sort+desc

result:
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">9</int>
<lst name="params">
<str name="sort">modified_sort desc</str>
<str name="qf">title_search^1.0</str>
<str name="q.alt">*:*</str>
<str name="debugOther">1</str>
<str name="debug">1</str>
<str name="rows">10</str>
<str name="pf">title_search^1.0</str>
<str name="fl">
last_modified,modified,modified_sort:last_modified,modified_sort:modified
</str>
<str name="debugQuery">true</str>
<str name="start">0</str>
<str name="q"/>
<str name="q.op">OR</str>
<str name="qt">/select</str>
</lst>
</lst>
<result name="response" numFound="17" start="0">
<doc>
<date name="last_modified">2013-04-12T00:00:00Z</date>
<date name="modified_sort">2013-04-12T00:00:00Z</date>
</doc>
<doc>
<date name="last_modified">2007-10-18T00:00:00Z</date>
<date name="modified">2007-10-18T00:00:00Z</date>
<date name="modified_sort">2007-10-18T00:00:00Z</date>
</doc>
<doc>
<date name="last_modified">2013-04-12T00:00:00Z</date>
<date name="modified_sort">2013-04-12T00:00:00Z</date>
</doc>
<doc>

Reply via email to