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<http://www.stats.govt.nz/>
[cid:[email protected]]
[cid:[email protected]]<https://www.facebook.com/StatisticsNZ>
[cid:[email protected]] <https://twitter.com/Stats_NZ>
[cid:[email protected]]
<https://www.linkedin.com/company/statistics-new-zealand>