HughCraig / TLCMap-support

0 stars 0 forks source link

Date Search Broken #45

Closed IanMcCrabb closed 3 weeks ago

IanMcCrabb commented 2 months ago

If I search on Date From = 1890, it spins and doesn't time out. Same if I search on just Date to = 1890. Same if I use date 1890-08-01. Same if I search from 1800-08-01 to 1890-08-01.

IanMcCrabb commented 2 months ago

@MufengNiu can you have look at this see if you can identify the issue. If its an easy enough fix we should just go ahead. If its looking like a more complex fix (involving data formats in data...) then we need to consider masking the feature until it can be budgeted/scheduled..

BillPascoe commented 1 month ago

If I set a date search as follows: Date From: 1800-01-01 Date To: 1805-01-01

It took 40 seconds the first time. This seems too long for a query that is just getting 200 (default) results within a range. I tested on a simple search just for 'Hawkesbury' and nothing else and it only took about 1 second. Then I moved the map and it timed out with an error.

I tried to reload the page by removing the query string and going to https://test-ghap.tlcmap.org/ and the whole test site is giving me 'This site can't be reached.' with 'ERR_CONNECTION_REFUSED'.

MufengNiu commented 1 month ago

If I set a date search as follows: Date From: 1800-01-01 Date To: 1805-01-01

It took 40 seconds the first time. This seems too long for a query that is just getting 200 (default) results within a range. I tested on a simple search just for 'Hawkesbury' and nothing else and it only took about 1 second. Then I moved the map and it timed out with an error.

I tried to reload the page by removing the query string and going to https://test-ghap.tlcmap.org/ and the whole test site is giving me 'This site can't be reached.' with 'ERR_CONNECTION_REFUSED'.

Hi @BillPascoe . Even though we only show 200 results on the page, the system still needs to go through all the places in database, which has over 720,000 entries. For simple searches like place names, we can easily run a direct query in the database, which makes the search much faster.

However, for date searches, the process is more complex because the date data is stored in various formats. This means the system has to search through each entry individually and apply a pattern-matching process to find the matching results. This extra work is why it takes longer for date searches.

BillPascoe commented 1 month ago

We will defer work on this. Remove 'Date From' and 'Date To' from the 'filters' list in Search. We will solve this in future with a seperate issue.

IanMcCrabb commented 1 month ago

@MufengNiu if you can comment the date function search feature we can go live on Wednesday

MufengNiu commented 3 weeks ago

I've hidden the date search function on the front page. In the future, we will standardize the date format in the database (e.g., using UNIX timestamps) and display them in a consistent format