cancel
Showing results for 
Search instead for 
Did you mean: 

Syntax for searching datetime property in Postman

ptellier
Champ in-the-making
Champ in-the-making

I have Alfresco Community v23.1.0

I'm using Postman to test my query. This returns 4 results:

{
"query": {
"query":"=tboacc:USERID_EDW:U92XXX"
},
"include": ["aspectNames", "properties", "isLink"]
}

One of the results has this property:
"tboacc:CLEARED_DATE_XXX": "2022-01-12T00:00:00.000+0000",

In Alfresco Node Browser the value is showing as datetime like this:
tboacc:CLEARED_DATE_XXX d:datetime 12 Jan 2022 00:00:00 GMT+0000 (UTC)

What is the correct syntax for finding this document using tboacc:CLEARED_DATE_XXX?

This returns 0 results:

{
"query": {
"query":"=tboacc:CLEARED_DATE_XXX:\"2022-01-12T00:00:00.000+0000\""
},
"include": ["aspectNames", "properties", "isLink"]
}

This returns 0 results:

{
"query": {
"query":"=tboacc:CLEARED_DATE_XXX:\"12 Jan 2022 00:00:00 GMT+0000 (UTC)\""
},
"include": ["aspectNames", "properties", "isLink"]
}

Also, what is the syntax for searching a date range?

3 REPLIES 3

robinp
Confirmed Champ
Confirmed Champ

Hi, 

if using Solr check this https://docs.alfresco.com/search-services/latest/using/#search-for-ranges .

I know, in this link there are not clear examples on how to do it with dates, but in this case it works in the same way in the search-enterprise .

Use the first link as documentation for every different query syntax problem

ptellier
Champ in-the-making
Champ in-the-making

Hello, robinp,

I'm following the syntax you suggested but it's still returning 0 results.  Here's what I'm trying:


This returns 100 records (53 with "ncispSmiley Tongueolicy_Number": "0202020202")
{
"query": {
"query":"=ncispSmiley Tongueolicy_Number:'0202020202'",
"language": "afts"
}
}

This returns 71 records:
{
"query": {
"query":"ncisp:F_EntryDate:['2024-01-12' TO '2024-01-13']",
"language": "afts"
},
"include": ["aspectNames", "properties", "isLink"]
}

But this returns 0 records:
{
"query": {
"query":"=ncispSmiley Tongueolicy_Number:'0202020202' AND ncisp:F_EntryDate:['2024-01-12' TO '2024-01-13']",
"language": "afts"
},
"include": ["aspectNames", "properties", "isLink"]
}

How do I combine a search for a single term with a date range search? 

ncisp:F_EntryDate is Data Type d:datetime and has Indexing:  Basic.

Hi,

The query syntax you are using seems to be right.
You confirm this by testing searchability on any node via cm:name:"XXX" and cm:created:['20XX-XX-XX' TO '20YY-YY-YY'].

I assume that there are nodes compatible with the search you are carrying out, so:

  • Have you tried to check if you still can't find results by widening the query range by date?
  • Do you have other datetime type properties that have the same problem?
  • If you create a node with the same characteristics you are looking for, are indexing errors raised?