SID-02371: Parameter "Date=" in %SEARCH-Function doesn't work
| Status: |
Answered |
TWiki version: |
6.0.0 |
Perl version: |
v5.10.0 |
| Category: |
CategorySearch |
Server OS: |
Suse Linux Enterprise Server 11 SP1 |
Last update: |
6 years ago |
I used following Statement in my "Sandbox Web" and it works fine.
%SEARCH{"\.*" scope="topic" type="regex" sort="modified" date="2014-01-01/2017-12-31" nosummary="on" nosearch="on"}%
I only get the topics in the list with the date between the given parameter.
If I try the exactly same statement in another web, sometimes I get topics with a shown date between 2013 and 2017, sometimes I get NO result. If I change the date-range to 2014-01-01/2018-12-31 i.e. in that web that showed no results, then the search shows all topcis from 2008 until 2018.
I tried other formats for the date, i.e "01 Jan 2014/31 Dec 2018" but the result is
Error: Cannot handle date (0, 0, 0, 01, 0, 199500)
--
Peter Starek - 2018-08-27
Discussion and Answer
Is no one there in the whole wide world to help me ;-( ?
--
Peter Starek - 2019-05-14
The format
2014-01-01/2018-12-31 is the correct one.
The only explanation I could offer is that "something else" changed the file modification date. The inclusion (or exclusion) in the search results depends on the modification time of the file in the file system and not on the time of the most recent change as you see in the topic's history. I don't know of a ready-made program to "fix" this, though.
In any case, as ever so often,
QuerySearch comes to the rescue. Try something like this, which actually parses the topic metadata (and hence will be slower than the "simple" one):
%SEARCH{"info[date >= d2n('2014-01-01')] AND info[date <= d2n('2017-12-31')] " type="query" sort="modified" nosummary="on" nosearch="on"}%
--
Harald Jörg - 2019-05-14
Your Statement for the
QuerySearch works great - many, many thanks.
--
Peter Starek - 2019-05-16
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.