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 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, Ahmet Arslan wrote:

 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 d...@globalsources.com
 wrote:
 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 on top
 and sortedby it and those documents which do not have the field below?

 -Derek






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 d...@globalsources.com wrote:
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 on top 
and sortedby it and those documents which do not have the field below?

-Derek


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, Ahmet Arslan wrote:

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 d...@globalsources.com wrote:
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 on top
and sortedby it and those documents which do not have the field below?

-Derek






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 don't index empty values for your fields or this will
mess up the sorting.
Solr manage the missing values ( that are null values), and does not manage
the empty  values.

Those values for a human are identical to null values, but not for solr.
So you can have very weird situations for your users.
So , to be sure everything work nice with sortMissing attribute, be sure to
not index empty values.

Cheers

2015-05-27 10:34 GMT+01:00 Rajani Maski rajani.ma...@lucidworks.com:

 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 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, Ahmet Arslan wrote:
 
  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 d...@globalsources.com
  wrote:
  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 on top
  and sortedby it and those documents which do not have the field below?
 
  -Derek
 
 
 
 




-- 
--

Benedetti Alessandro
Visiting card : http://about.me/alessandro_benedetti

Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?

William Blake - Songs of Experience -1794 England


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 PM, Derek Poh d...@globalsources.com wrote:


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, Ahmet Arslan wrote:


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 d...@globalsources.com
wrote:
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 on top
and sortedby it and those documents which do not have the field below?

-Derek







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 to add a bonus note, related the ( empty ) and null concept.

Be very careful you don't index empty values for your fields or this will
mess up the sorting.
Solr manage the missing values ( that are null values), and does not manage
the empty  values.

Those values for a human are identical to null values, but not for solr.
So you can have very weird situations for your users.
So , to be sure everything work nice with sortMissing attribute, be sure to
not index empty values.

Cheers

2015-05-27 10:34 GMT+01:00 Rajani Maski rajani.ma...@lucidworks.com:


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 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, Ahmet Arslan wrote:


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 d...@globalsources.com
wrote:
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 on top
and sortedby it and those documents which do not have the field below?

-Derek