Hi,
About not reindexing old stuff, I tried to do it with commands only,
without success... Maybe someone can suggests improvements...
[form]
Known indexes:
[(list {(info list page=site.index)} template='[radio rule {+p}] {+p}')]
[submit "BUILD INDEX"]
[command if "! set {=rule} ? warn='Please choose an index rule.'"]
[command warn]
/*get search parameters for indexing*/
[command source_1 site.index::{=rule} escape=false]
/*{=source_1} certainly contains a "when" parameter already, making us
unable to check for the time; let's start by retrieving all the mathcing
pages and then only keep the ones modified since last indexing*/
[command search_1 {=source_1} fmt=csv count=false dir=pages
sort=lastmodified]
[command search_1]
[command search_2 pages='{=search_1}' when='! set {site.index:{=rule}_time}
|| time {(lastmodified {+p})} after={site.index:{=rule}_time}' count=false
sort=false fmt=list]
[command search_2]
/*append, don't erase pages that are still waiting to be indexed*/
[command source_2 site.index.{=rule} if='set {=rule}']
[command edit content='{=source_2}\n{=search_2}' lines=true page=site.index
.{=rule} if='set {=rule}']
/*get time for next indexing*/
[command time %x]
[command {=rule}_time {=time}]
[command savedata {=rule}_time page=site.index]
[command nextpage action.index&rule={=rule}]
[form]
Two issues here:
- "time" data var always set to empty value
- Last modification date check not working. I manually added a timestamp to
the "time" data var of the rule I was testing, in order to go around
previously-mentioned bug. I had a look into parameters of the time
conditionals, and it seems it is always taking the value of $BOLTtime
instead of the last modified date of the page.
Also, I first tried with [command if "set {=rule} && set
{site.index:{=rule}_time} ? search='{=source_1} fmt=list count=false
dir=pages sort=lastmodified when=\"time {(lastmodified {+p})}
after={site.index:{=rule}_time}\"' : search='{=source_1} fmt=list
count=false dir=pages sort=lastmodified'"] but I guess the content of the
when parameter is never read. I also tried [command search {=source_1}
fmt=list count=false dir=pages sort=lastmodified when='! set
{site.index:{=rule}_time} || time {(lastmodified {+p})}
after={site.index:{=rule}_time}'] with no better results.
It would be great to be able to do this without a single line of code, such
that each webadmin can do what suits best their website.
Cheers,
Tiffany
Le mercredi 13 janvier 2016 15:24:51 UTC+1, Dan a écrit :
>
> Great. I just update the docs. :)
>
> On Wed, Jan 13, 2016 at 2:06 AM Tiffany Grenier <[email protected]
> <javascript:>> wrote:
>
>> Hi Dan,
>> I thin I'll go for the variable, in order to ensure consistency between
>> indexing and reading indexes.
>> BoltWire offers so many possibilities, it's so easy to forget about one!
>> Thanks for all your help!
>> Tiffany
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "BoltWire" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/boltwire.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
--
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/boltwire.
For more options, visit https://groups.google.com/d/optout.