Something’s not quite right here. The format 2019-02-28 should fail to index 
unless you’re using a DateRangeField. So my guess is that somehow you’re really 
submitting the date with the time or some other surprise.

Or perhaps you’re using the “schemaless” mode which can transform dates, we 
recommend against that.

Best,
Erick

> On May 8, 2019, at 7:00 PM, Karthik Gunasekaran 
> <[email protected]> wrote:
> 
> Hi,
> I am new to solr. I am using solr7.6 version. 
>  
> The problem which I am facing is to format the date for a specific field.
>  
> Explanation of my issue: 
>  
> I have a collection named “DateFieldTest”
> It has few fields out of “initial_release_date” is a field of type pdate.
> We are loading the data into the collection as below
>  
>  
> [
>   {
>     "id": 0,
>     "Number": 0,
>     "String": "This is a string 0",
>     "initial_release_date": "2019-02-28"
>   },
>   {
>     "ID": 1,
>     "Number": 1,
>     "String": "This is a string 1",
>     " initial_release_date ": "2019-02-28"
>   }]
>  
> When we do a select query as 
> http://localhost:8983/solr/DateFieldTest/select?q=*:*
> We are getting the output as,
> {
>   "responseHeader":{
>     "zkConnected":true,
>     "status":0,
>     "QTime":0,
>     "params":{
>       "q":"*:*"}},
>   "response":{"numFound":1000,"start":0,"docs":[
>       {
>         "id":"0",
>         "Number":[0],
>         "String":["This is a Māori macron 0"],
>         "initial_release_date":["2019-02-28T00:00:00Z"],
>         "_version_":1633015101576445952},
>       {
>         "ID":[1],
>         "Number":[1],
>         "String":["This is a Māori macron 1"],
>         "initial_release_date":["2019-02-28T00:00:00Z"],
>         "_version_":1633015101949739008},
>  
> But our use case is to get the output for the above query is to get the 
> initial_release_date field to be formatted as YYYY-MM-DD.
> The query returns by adding time to the data field automatically, which we 
> don’t want to happen.
> Can someone please help me to resolve this issue to get only date value 
> without time in my select query.
>  
> Thanks,
> Karthik Gunasekaran
> Senior Applications Developer | kaiwhakawhanake Pūmanawa Tautono
> Digital Business  - Channels | Ngā Ratonga Mamati - Ngā Hongere
> Digital Business Services | Ngā Ratonga Pakihi Mamati
> Stats NZ Tatauranga Aotearoa 
> DDI +64 4 931 4347 | stats.govt.nz
> <image001.jpg>
> <image002.png>  <image003.png>  <image004.png>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to