Hi Diogene,

2007/10/23, Diogene Laerce <[EMAIL PROTECTED]>:
> Is it possible to download the bases.dmxp (xml format) from the server
> and where ?

No. The bases.dmxp file contains sensitive information (who has voted
on what) and is never going to be released to the public.

> Purpose : The search engine would need to update its corpus
> automatically (every day or week), and so will need to connect to the
> base to download it all, parse the xml and build a new xml file it could
> read (with the proper headers).

Use the regular RPC API to get the update on each question. There is a
timestamp mechanism to know if a question has been changed. Look at
RPC get_timestamp() in the demexp book.

In short, a timestamp, an integer counter, is incremented each time a
question, tag, etc. is modified. You have the timestamp in the data
structure of each question, tag, etc. Moreover, you can use the
get_timestamp() RPC to get all the timestamps at once.

As an added bonus, on the XML-RPC proxy, you have two RPCs available:
 * get_timestamp(), the same as the get_timestamp() ONC-RPC;

 * get_timestamp_decoded(), returns the timestamp as arrays of
integers (instead of the compressed version of the get_timestamp()

So, if you want to check at regular interval all the questions, you should:

 * Issue get_timestamp() (or get_timestamp_decoded()) to get all the
timestamps. Compare the returned value with the value you stored.

 * For each question that has a different timestamp, issue a
question_info() to update your local copy of the question.


Demexp-dev mailing list

Répondre à