sort on fields that are not mandatory in each document

2015-05-27 Thread Derek Poh
Hi I am trying to sort on multiple fields. These fields donot necessary exist in every document. sort=sppddrank asc, ddrank asc From the sorted result, it seems that documents which donot have sppddrank field is at the top. How can I make the documents that have the sppddrank field to be

Re: sort on fields that are not mandatory in each document

2015-05-27 Thread Rajani Maski
Hi Derek, They are at the fieldType Level. You might find some reference examples in schema.xml using them. https://cwiki.apache.org/confluence/display/solr/Field+Type+Definitions+and+Properties On Wed, May 27, 2015 at 2:30 PM, Derek Poh d...@globalsources.com wrote: Hi Ahmet The

Re: sort on fields that are not mandatory in each document

2015-05-27 Thread Ahmet Arslan
Hi, I think you are looking for sortMissing* attributes: sortMissingLast and sortMissingFirst attributes are optional attributes are currently supported on types that are sorted internally as strings and on numeric types. Ahmet On Wednesday, May 27, 2015 11:36 AM, Derek Poh

Re: sort on fields that are not mandatory in each document

2015-05-27 Thread Derek Poh
Hi Ahmet The sortMissingLast and sortMissingFirst attributes are defined at the field or fieldType level? field name=P_TSRank type=int indexed=true stored=true multiValued=false/ fieldType name=int class=solr.TrieIntField precisionStep=0 positionIncrementGap=0/ On 5/27/2015 4:43 PM,

Re: sort on fields that are not mandatory in each document

2015-05-27 Thread Alessandro Benedetti
Actually it is both field level and field type level. You decide based on your use case ( can happen that for the same field type , you want sortMissingFirst for one field, and sortMissingLast for another) . I want to add a bonus note, related the ( empty ) and null concept. Be very careful you

Re: sort on fields that are not mandatory in each document

2015-05-27 Thread Derek Poh
Got it. Thank you Rajani. On 5/27/2015 5:34 PM, Rajani Maski wrote: Hi Derek, They are at the fieldType Level. You might find some reference examples in schema.xml using them. https://cwiki.apache.org/confluence/display/solr/Field+Type+Definitions+and+Properties On Wed, May 27, 2015 at 2:30

Re: sort on fields that are not mandatory in each document

2015-05-27 Thread Derek Poh
Oh ok. Thank youAlessandro. On 5/27/2015 6:07 PM, Alessandro Benedetti wrote: Actually it is both field level and field type level. You decide based on your use case ( can happen that for the same field type , you want sortMissingFirst for one field, and sortMissingLast for another) . I want