Alfresco Full Text Search returning wrong results

cancel
Showing results for 
Search instead for 
Did you mean: 
srikanth94
Active Member

Alfresco Full Text Search returning wrong results

Hi,

I have a document that is uploaded at Tue 26 Nov 2019 19:13:02 (As shown on Alfresco Share Screen), and in node browser we have the document created date as 

cm:created
d:datetime
26 Nov 2019 19:13:02 GMT-0500 (EST)

 

So When im doing a AFTS with created date ,

cm:created:['2019-11-26T19:00:00' TO '2019-11-26T23:00:00']

i see No results (I'm on EST timezone)

even tried using AFTS serch from node browser i see No results, I tried using ReST API for Search Service forming something as below (added the timezone in localization to get results)

{"query": { "language":"afts", "query": "cm:created:['2019-11-26' TO '2019-11-26']"},"localization":{"timezone":"GMT+05:00"}}

But if i use a query with 27-11-2019 (i.e the next day) i'm able to see the results

cm:created:['2019-11-27T00:13:00' TO '2019-11-27T01:00:00']

Kindly help me on how to form query in ReST Search API, without changing the created date.
and help me on how this localization in query working and how alfresco full text search works on timezones

 

Thanks in advance 

 

4 Replies
jljwoznica
Senior Member

Re: Alfresco Full Text Search returning wrong results

I tried this and as long as I use GMT time for my search, the proper information is returned. For example, I added something today with the following creation date:

Screen Shot 2019-12-23 at 10.04.31 AM.png

Notice that GMT is 14:49:34. I executed the following search:

Screen Shot 2019-12-23 at 10.04.22 AM.png

So, using today's date this worked fine. I narrowed the date down to seconds around the creation date:

Screen Shot 2019-12-23 at 10.11.17 AM.png

And it also returned the file with today's date. I think your issue is GMT.

srikanth94
Active Member

Re: Alfresco Full Text Search returning wrong results

As long as we are in GMT, it is showing up results correctly, But in my case the user is in EST and he uploads the documents, at node level it is storing in GMT.

I doubt the search results are displayed from the DB, where it is returning the GMT results

1. User from EST uploads document at 26 Nov 2019 19:13:02

2. And he tries to search the doc that he has uploaded on 26th, but the date that is stored at backend is in GMT (i.e 27 Nov 2019 00:13:02).

3. So, as the document is having 27th at node level, it is not coming up in the result set'

Does search results display based on GMT(UTC) by default? is there a way to overcome this making results compatible with clients local time zone 

As a workaround im sending 26 Nov 2019 19:13:02-0500 , i.e converting GMT to EST and this is bring up the results. But this cant be helpful if there are mutiple user from multiple time zone 

jljwoznica
Senior Member

Re: Alfresco Full Text Search returning wrong results

I found a previous post about this....https://hub.alfresco.com/t5/alfresco-content-services-forum/serious-date-time-problems-in-alfresco/t... that has some suggestions. 

I am not sure which API you are using, but I believe the REST API provides a parameter for timezone.

 

srikanth94
Active Member

Re: Alfresco Full Text Search returning wrong results

I have gone through that post and tried using the same, but i was unscuccessful . the query im trying is mentioned in my main post 

{"query": { "language":"afts", "query": "cm:created:['2019-11-26' TO '2019-11-26']"},"localization":{"timezone":"GMT+05:00"}}