On 7/10/2019 7:22 AM, Santosh Kumar S wrote:
When we try sorting it, then the records are getting sorted based on
Timestamp, but we need to sort only on date part keeping timestamp part
aside.

That is how sorting on a field that has a timestamp is going to work. It will always use the whole field.

Here we would like the sort to consider only the date part of the field and
then use the name field.
In this way, documents for different dates will appear sorted first by date
(without time) and then by name.

If you want to only sort by date without the time, you will need a field into which you index date only, either without the timestamp or with a common timestamp (probably 00:00:00.000). If going with date only, it's probably better to use a string field than a date field. It's up to you whether you change the existing date field and update your indexing software, or add a new one and have your indexing program copy the date from the date field to a text field.

I do not know whether the ParseDateFieldUpdateProcessorFactory could be used to handle this on the Solr side with a copyField:

https://lucene.apache.org/solr/7_2_0//solr-core/org/apache/solr/update/processor/ParseDateFieldUpdateProcessorFactory.html

Once you have the correct date only field, you would have to simply use a parameter like this:

sort=date_only asc, name asc

Thanks,
Shawn

Reply via email to