Re: How can I delete the entire contents of the index?

2010-09-23 Thread Ryan McKinley
deletequery*:*/query/delete

will leave you a fresh index


On Thu, Sep 23, 2010 at 12:50 AM, xu cheng xcheng@gmail.com wrote:
 deletequerythe query that fetch the data you wanna
 delete/query/delete
 I did like this to delete my data
 best regards

 2010/9/23 Igor Chudov ichu...@gmail.com

 Let's say that I added a number of elements to Solr (I use
 Webservice::Solr as the interface to do so).

 Then I change my mind and want to delete them all.

 How can I delete all contents of the database, but leave the database
 itself, just empty?

 Thanks

 i




Re: How can I delete the entire contents of the index?

2010-09-23 Thread kenf_nc

Quick tangent... I went to the link you provided, and the delete part makes
sense. But the next tip, how to re-index after a schema change. What is the
point of step

5. Send an optimize/ command.

? Why do you need to optimize an empty index? Or is my understanding of
Optimize incorrect?
-- 
View this message in context: 
http://lucene.472066.n3.nabble.com/How-can-I-delete-the-entire-contents-of-the-index-tp1565548p1567640.html
Sent from the Solr - User mailing list archive at Nabble.com.


RE: How can I delete the entire contents of the index?

2010-09-23 Thread Jonathan Rochkind
Because even after you've deleted every document from the index, there are 
still actually index _files_ on disk taking up space.  Lucene organizes it's 
files for quick access, and a consequence of this is that deleting a document 
does not neccesarily reclaim the disk space.   Optimize will reclaim that disk 
space. 

For deleting ALL documents in your index there's actually a shortcut though. 
Delete the entire solr 'data' directory and restart Solr, Solr will recreate 
the data directory with starter index files.  (Note you have to delete the 
directory itself, if you just delete all the files inside it, Solr will get 
unhappy).   I am somewhat suspicious of doing this and would never do it on a 
production index, but for just development playing around where it's not that 
disastrous if something goes wrong, it's a lot lot quicker than an actual 
delete command followed by an optimize. 

From: kenf_nc [ken.fos...@realestate.com]
Sent: Thursday, September 23, 2010 8:22 AM
To: solr-user@lucene.apache.org
Subject: Re: How can I delete the entire contents of the index?

Quick tangent... I went to the link you provided, and the delete part makes
sense. But the next tip, how to re-index after a schema change. What is the
point of step

5. Send an optimize/ command.

? Why do you need to optimize an empty index? Or is my understanding of
Optimize incorrect?
--
View this message in context: 
http://lucene.472066.n3.nabble.com/How-can-I-delete-the-entire-contents-of-the-index-tp1565548p1567640.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: How can I delete the entire contents of the index?

2010-09-23 Thread Michael McCandless
Lucene has an API for very fast deletion of the index (ie, it removes
the files): IndexWriter.deleteAll().  It's part of the transaction,
ie, you still must call .commit() to make the change visible to
external readers.

But I don't know whether this is exposed in Solr...

Mike

On Thu, Sep 23, 2010 at 8:50 AM, Jonathan Rochkind rochk...@jhu.edu wrote:
 Because even after you've deleted every document from the index, there are 
 still actually index _files_ on disk taking up space.  Lucene organizes it's 
 files for quick access, and a consequence of this is that deleting a document 
 does not neccesarily reclaim the disk space.   Optimize will reclaim that 
 disk space.

 For deleting ALL documents in your index there's actually a shortcut though. 
 Delete the entire solr 'data' directory and restart Solr, Solr will recreate 
 the data directory with starter index files.  (Note you have to delete the 
 directory itself, if you just delete all the files inside it, Solr will get 
 unhappy).   I am somewhat suspicious of doing this and would never do it on a 
 production index, but for just development playing around where it's not that 
 disastrous if something goes wrong, it's a lot lot quicker than an actual 
 delete command followed by an optimize.
 
 From: kenf_nc [ken.fos...@realestate.com]
 Sent: Thursday, September 23, 2010 8:22 AM
 To: solr-user@lucene.apache.org
 Subject: Re: How can I delete the entire contents of the index?

 Quick tangent... I went to the link you provided, and the delete part makes
 sense. But the next tip, how to re-index after a schema change. What is the
 point of step

    5. Send an optimize/ command.

 ? Why do you need to optimize an empty index? Or is my understanding of
 Optimize incorrect?
 --
 View this message in context: 
 http://lucene.472066.n3.nabble.com/How-can-I-delete-the-entire-contents-of-the-index-tp1565548p1567640.html
 Sent from the Solr - User mailing list archive at Nabble.com.



Re: How can I delete the entire contents of the index?

2010-09-23 Thread Chris Hostetter
: Lucene has an API for very fast deletion of the index (ie, it removes
: the files): IndexWriter.deleteAll().  It's part of the transaction,
...
: But I don't know whether this is exposed in Solr...

Solr definitely has optimized the delete *:* case (but i don't know if 
it's using the specific method)

I believe the poster is getting confused because immediately following 
this FAQ...

http://wiki.apache.org/solr/FAQ#How_can_I_delete_all_documents_from_my_index.3F

which says to use deletequery*:*/query/delete which specificly 
notes: This has been optimized to be more efficient then deleting by some 
arbitrary query which matches all docs because of the nature of the data.

...was this FAQ...

http://wiki.apache.org/solr/FAQ#How_can_I_rebuild_my_index_from_scratch_if_I_change_my_schema.3F

...which until a moment ago gave outdated advice.

-Hoss

--

http://lucenerevolution.org/  ...  October 7-8, Boston
http://bit.ly/stump-hoss  ...  Stump The Chump!



How can I delete the entire contents of the index?

2010-09-22 Thread Igor Chudov
Let's say that I added a number of elements to Solr (I use
Webservice::Solr as the interface to do so).

Then I change my mind and want to delete them all.

How can I delete all contents of the database, but leave the database
itself, just empty?

Thanks

i


Re: How can I delete the entire contents of the index?

2010-09-22 Thread xu cheng
deletequerythe query that fetch the data you wanna
delete/query/delete
I did like this to delete my data
best regards

2010/9/23 Igor Chudov ichu...@gmail.com

 Let's say that I added a number of elements to Solr (I use
 Webservice::Solr as the interface to do so).

 Then I change my mind and want to delete them all.

 How can I delete all contents of the database, but leave the database
 itself, just empty?

 Thanks

 i



Re: How can I delete the entire contents of the index?

2010-09-22 Thread Gora Mohanty
On Thu, Sep 23, 2010 at 9:05 AM, Igor Chudov ichu...@gmail.com wrote:
 Let's say that I added a number of elements to Solr (I use
 Webservice::Solr as the interface to do so).

 Then I change my mind and want to delete them all.

 How can I delete all contents of the database, but leave the database
 itself, just empty?

Not sure what you mean by leave the database itself. Solr is not a normal
database, and thus there is not much sense to an empty index. In any case,
to delete all entries, see entry 2.7 in the Solr FAQ on the Wiki:
http://wiki.apache.org/solr/FAQ#How_can_I_delete_all_documents_from_my_index.3F

Regards,
Gora