Have you looked at 
https://docs.marklogic.com/admin:database-add-range-element-index yet?

I'm not clear on what you mean by "invalid documents". But if you create a 
range index and reindexing is enabled, then each forest will automatically 
reingest documents as needed. There's no need to delete any existing documents. 
There's a brief note about this at the end of 
https://docs.marklogic.com/guide/admin/range_index#id_51346 but maybe it could 
be improved.

If reindexing might be disabled, you could use 
https://docs.marklogic.com/admin:database-set-reindexer-enable to turn it on. 
To monitor progress until it's done, I believe 
https://docs.marklogic.com/xdmp:forest-status will report the reindexer status 
per forest.

Once you have some XQuery snippets that do what you want, you'll need to call 
them from the command line somehow. There are various options for that. If you 
want to use REST calls, you could use 
https://docs.marklogic.com/REST/management and 
https://docs.marklogic.com/REST/packaging for some parts and write extensions 
for other parts. For example you could apply a new configuration package that 
creates your range index.

-- Mike

> On 9 Dec 2014, at 14:02 , Jenny Wang <[email protected]> wrote:
> 
> Classification: Public
> 
> I’m working on an automation scenario which consists of two steps: first 
> ingest some data with a missing range index, this will result in some invalid 
> documents in MarkLogic. Then after adding the range index, I’ll need to 
> reingest the data saved in MarkLogic and verify valid documents are 
> generated. Is there a way to add a range index without removing documents in 
> the database? Note that I have to do it from command line, so adding the 
> index from UI doesn’t solve my problem.
>  
>  
> Jenny
>  
>  
> 
> 
> ---
> This communication may contain confidential and/or privileged information. If 
> you are not the intended recipient (or have received this communication in 
> error) please notify the sender immediately and destroy this communication. 
> Any unauthorized copying, disclosure or distribution of the material in this 
> communication is strictly forbidden.
> 
> Deutsche Bank does not render legal or tax advice, and the information 
> contained in this communication should not be regarded as such.
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to