You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Geetha <ge...@angleritech.com> on 2009/04/22 09:09:36 UTC

how to reset the index in solr

I need to clearing the index in solr.

I would appreciate anyone help
-- 

Best Regards,
** 
*Geetha  S *| System and Software Engineer
email: geetha@angleritech.com <ma...@angleritech.com>

*
Visit us at ICT Expo, HongKong (13th-16th Apr 2009) and Internet World, 
UK (28-30 Apr 2009)*

*Click here for FREE TICKETS: 
*http://www.angleritech.com/company/latest-technology-news-events.html

 

*ANGLER Technologies India - Your Offshore Development Partner -- An ISO 
9001 Company*

Contact us for your high quality Software Outsourcing 
<http://www.angleritech.com/offshore/outsourced_product_development.html>, 
E-Business Products <http://www.angleritech.com/ebusiness/index.html> 
and Design Solutions <http://www.angleritech.com/design/index.html>

/* */

web         :    www.angleritech.com <http://www.angleritech.com/>
tel           :    +91 422 2312707, 2313938
fax           :    +91 422 2313936
address   :*    *1144 Trichy Road, Coimbatore, 641045, India

offices <http://www.angleritech.com/contact/index.html>_ _     :  
  India | USA | UK | Canada | Europe | UAE | South Africa | Singapore | 
Hong Kong

* *

*Disclaimer: *The information in the email, files and communication are 
strictly confidential and meant for the intended recipients. It may 
contain proprietary information. If you are not an intended recipient; 
any form of disclosure, copyright, distribution and any other means of 
use of information is unauthorised and subject to legal implications. We 
do not accept any liability for the transmission of incomplete, delayed 
communication and recipients must check this email and any attachments 
for the presence of viruses before downloading them.

 

 


Re: how to reset the index in solr

Posted by delk <se...@gmail.com>.
If you want to delete all items from Solr index, use the query

<delete><query>*:*</query></delete>




-----
Development Center Toronto 
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: how to reset the index in solr

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
you can send in a delete request by query for *:*, that'll remove  
everything from the index.

	Erik

On Apr 22, 2009, at 7:57 AM, sagi4 wrote:

>
> Thanks for your response.
>
> I want to clear it basically, it means clearing the index
>
> Thank you
> Sg..
>
>
>
> What do you mean? To delete it or to reload it?
> If you want to delete it just delete ./data/index folder.
>
> If you want to reload just reload your server if you can.
>
> In case you are using cores you can just reload a core with all it's
> configuration
> http://localhost:8080/solr/admin/cores?action=RELOAD&core=core_name
>
>
> I need to clearing the index in solr.
>
> I would appreciate anyone help
> -- 
>
> Best Regards,
> **
> *Geetha  S *
>
>
>
>
> -- 
> View this message in context: http://www.nabble.com/how-to-reset-the-index-in-solr-tp23170853p23174806.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: how to reset the index in solr

Posted by Gabriele Kahlout <ga...@mysimpatico.com>.
Solved. The correct translation of Marcus cmd:
$ curl http://localhost:8080/solr/update?commit=true -H "Content-Type:
text/xml" --data-binary '<delete><query>*:*</query></delete>'

http://stackoverflow.com/questions/2358476/solr-delete-not-working-for-some-reason

NB: the response is still not what I'd expect:

<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int
name="QTime">57</int></lst>
</response>


On Wed, Apr 6, 2011 at 11:39 AM, Gabriele Kahlout
<ga...@mysimpatico.com>wrote:

> Hi Marcus,
>
> Your curl cmds don't work in that format on my unix. I conver them as
> follows, and they still don't work:
>
> $ curl --fail $solrIndex/update?commit=true -d  '*:*'
> $ curl --fail $solrIndex/update -d  ''
>
> From the browser:
>
> http://localhost:8080/solr/update?commit=true%20-d%20%27%3Cdelete%3E%3Cquery%3E*:*%3C/query%3E%3C/delete%3E%27
>
> This is the response I get.
>
> −
>
> 0
> 18
>
>
>
> The only thing that works:
> $rm - r SOLR_HOME/solr
> $CATALINA_HOME/bin/catalina.sh stop
> $CATALINA_HOME/bin/catalina.sh start
>
> I'm running a single core instance.
> I'm using this nutch script [1] and this[2] hints at my solr config.
>
> [1]
> http://wiki.apache.org/nutch/Whole-Web%20Crawling%20incremental%20script
> [2]
>
> http://wiki.apache.org/solr/Troubleshooting%20HTTP%20Status%20404%20-%20missing%20core%20name%20in%20path?action=recall&rev=1
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/how-to-reset-the-index-in-solr-tp496574p2784198.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Regards,
K. Gabriele

--- unchanged since 20/9/10 ---
P.S. If the subject contains "[LON]" or the addressee acknowledges the
receipt within 48 hours then I don't resend the email.
subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧ time(x)
< Now + 48h) ⇒ ¬resend(I, this).

If an email is sent by a sender that is not a trusted contact or the email
does not contain a valid code then the email is not received. A valid code
starts with a hyphen and ends with "X".
∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
L(-[a-z]+[0-9]X)).

Re: how to reset the index in solr

Posted by Gabriele Kahlout <ga...@mysimpatico.com>.
Hi Marcus,

Your curl cmds don't work in that format on my unix. I conver them as
follows, and they still don't work:

$ curl --fail $solrIndex/update?commit=true -d  '*:*'
$ curl --fail $solrIndex/update -d  '' 

>From the browser:
http://localhost:8080/solr/update?commit=true%20-d%20%27%3Cdelete%3E%3Cquery%3E*:*%3C/query%3E%3C/delete%3E%27

This is the response I get.

−

0
18



The only thing that works:
$rm - r SOLR_HOME/solr 
$CATALINA_HOME/bin/catalina.sh stop
$CATALINA_HOME/bin/catalina.sh start

I'm running a single core instance.
I'm using this nutch script [1] and this[2] hints at my solr config.

[1] http://wiki.apache.org/nutch/Whole-Web%20Crawling%20incremental%20script
[2]
http://wiki.apache.org/solr/Troubleshooting%20HTTP%20Status%20404%20-%20missing%20core%20name%20in%20path?action=recall&rev=1

--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-reset-the-index-in-solr-tp496574p2784198.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: how to reset the index in solr

Posted by Marcus Herou <ma...@tailsweep.com>.
Or....

curl http://$server:$port/solr/$core/update -H "Content-Type: text/xml"
--data-binary '<delete><query>*:*</query></delete>'
curl http://$server:$port/solr/$core/update -H "Content-Type: text/xml"
--data-binary '<commit />'
curl http://$server:$port/solr/$core/update -H "Content-Type: text/xml"
--data-binary '<optimize />'

//Marcus

On Thu, Apr 30, 2009 at 8:23 AM, Geetha <ge...@angleritech.com> wrote:

> Thanks a lot Erik. I would try it and let me know
>
>
>
> Erik Hatcher wrote:
>
>>
>> On Apr 29, 2009, at 12:19 AM, Geetha wrote:
>>
>>> I need a function (through solr ruby) for ruby that will allow us to
>>> clear everything
>>>
>>
>> require 'solr'
>> solr = Solr::Connection.new("http://localhost:8983/solr")
>> solr.delete_by_query('*:*')
>> solr.commit
>>
>>    Erik
>>
>>
>>
>
> --
>
> Best Regards,
> ** *Geetha  S *| System and Software Engineer
> email: geetha@angleritech.com <ma...@angleritech.com>
>
> *
> *
>
>
> *
> *Visit us at **Internet World, UK** (**28th-30th Apr 2009**)*
> *Click here for FREE TICKETS:** *
> http://www.angleritech.com/company/latest-technology-news-events.html
> *
>
>
>
> *ANGLER Technologies India - Your Offshore Development Partner -- An ISO
> 9001 Company*
>
> Contact us for your high quality Software Outsourcing <
> http://www.angleritech.com/offshore/outsourced_product_development.html>,
> E-Business Products <http://www.angleritech.com/ebusiness/index.html> and
> Design Solutions <http://www.angleritech.com/design/index.html>
>
> /* */
>
> web         :    www.angleritech.com <http://www.angleritech.com/>
> tel           :    +91 422 2312707, 2313938
> fax           :    +91 422 2313936
> address   :*    *1144 Trichy Road, Coimbatore, 641045, India
>
> offices <http://www.angleritech.com/contact/index.html>_ _     :   India |
> USA | UK | Canada | Europe | UAE | South Africa | Singapore | Hong Kong
>
> * *
>
> *Disclaimer: *The information in the email, files and communication are
> strictly confidential and meant for the intended recipients. It may contain
> proprietary information. If you are not an intended recipient; any form of
> disclosure, copyright, distribution and any other means of use of
> information is unauthorised and subject to legal implications. We do not
> accept any liability for the transmission of incomplete, delayed
> communication and recipients must check this email and any attachments for
> the presence of viruses before downloading them.
>
>
>
>
>
>


-- 
Marcus Herou CTO and co-founder Tailsweep AB
+46702561312
marcus.herou@tailsweep.com
http://www.tailsweep.com/
http://blogg.tailsweep.com/

Re: how to reset the index in solr

Posted by Geetha <ge...@angleritech.com>.
Thanks a lot Erik. I would try it and let me know


Erik Hatcher wrote:
>
> On Apr 29, 2009, at 12:19 AM, Geetha wrote:
>> I need a function (through solr ruby) for ruby that will allow us to 
>> clear everything
>
> require 'solr'
> solr = Solr::Connection.new("http://localhost:8983/solr")
> solr.delete_by_query('*:*')
> solr.commit
>
>     Erik
>
>


-- 

Best Regards,
** 
*Geetha  S *| System and Software Engineer
email: geetha@angleritech.com <ma...@angleritech.com>

*
*


*
*Visit us at **Internet World, UK** (**28th-30th Apr 2009**)*
*Click here for FREE TICKETS:** 
*http://www.angleritech.com/company/latest-technology-news-events.html
*

 

*ANGLER Technologies India - Your Offshore Development Partner -- An ISO 
9001 Company*

Contact us for your high quality Software Outsourcing 
<http://www.angleritech.com/offshore/outsourced_product_development.html>, 
E-Business Products <http://www.angleritech.com/ebusiness/index.html> 
and Design Solutions <http://www.angleritech.com/design/index.html>

/* */

web         :    www.angleritech.com <http://www.angleritech.com/>
tel           :    +91 422 2312707, 2313938
fax           :    +91 422 2313936
address   :*    *1144 Trichy Road, Coimbatore, 641045, India

offices <http://www.angleritech.com/contact/index.html>_ _     :  
  India | USA | UK | Canada | Europe | UAE | South Africa | Singapore | 
Hong Kong

* *

*Disclaimer: *The information in the email, files and communication are 
strictly confidential and meant for the intended recipients. It may 
contain proprietary information. If you are not an intended recipient; 
any form of disclosure, copyright, distribution and any other means of 
use of information is unauthorised and subject to legal implications. We 
do not accept any liability for the transmission of incomplete, delayed 
communication and recipients must check this email and any attachments 
for the presence of viruses before downloading them.

 

 


Re: how to reset the index in solr

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 29, 2009, at 12:19 AM, Geetha wrote:
> I need a function (through solr ruby) for ruby that will allow us to  
> clear everything

require 'solr'
solr = Solr::Connection.new("http://localhost:8983/solr")
solr.delete_by_query('*:*')
solr.commit

	Erik


Re: how to reset the index in solr

Posted by Geetha <ge...@angleritech.com>.
I need a function (through solr ruby) for ruby that will allow us to 
clear everything

regards,
Sg..

Geetha wrote:
> Thank you Erik..
>
> Should I write the below code in rake task /lib/tasks/solr.rake?
>
> I am newbie to ruby.
>
>
> Erik Hatcher wrote:
>>
>> On Apr 24, 2009, at 1:54 AM, sagi4 wrote:
>>> Can i get the rake task for clearing the index of solr, I mean "rake
>>> index::rebuild", It would be very helpful and also to avoid the 
>>> delete id by
>>> manually.
>>
>> How do you currently build your index?
>>
>> But making a Rake task to do perform Solr operations is generally 
>> pretty trivial.  In Ruby (after gem install solr-ruby):
>>
>>    require 'solr'
>>    solr = Solr::Connection.new("http://localhost:8983/solr")
>>    solr.optimize  # for example
>>
>>     Erik
>>
>>
>
>
>
>


-- 

Best Regards,
** 
*Geetha  S *| System and Software Engineer
email: geetha@angleritech.com <ma...@angleritech.com>

*
*


*
*Visit us at **Internet World, UK** (**28th-30th Apr 2009**)*
*Click here for FREE TICKETS:** 
*http://www.angleritech.com/company/latest-technology-news-events.html
*

 

*ANGLER Technologies India - Your Offshore Development Partner -- An ISO 
9001 Company*

Contact us for your high quality Software Outsourcing 
<http://www.angleritech.com/offshore/outsourced_product_development.html>, 
E-Business Products <http://www.angleritech.com/ebusiness/index.html> 
and Design Solutions <http://www.angleritech.com/design/index.html>

/* */

web         :    www.angleritech.com <http://www.angleritech.com/>
tel           :    +91 422 2312707, 2313938
fax           :    +91 422 2313936
address   :*    *1144 Trichy Road, Coimbatore, 641045, India

offices <http://www.angleritech.com/contact/index.html>_ _     :  
  India | USA | UK | Canada | Europe | UAE | South Africa | Singapore | 
Hong Kong

* *

*Disclaimer: *The information in the email, files and communication are 
strictly confidential and meant for the intended recipients. It may 
contain proprietary information. If you are not an intended recipient; 
any form of disclosure, copyright, distribution and any other means of 
use of information is unauthorised and subject to legal implications. We 
do not accept any liability for the transmission of incomplete, delayed 
communication and recipients must check this email and any attachments 
for the presence of viruses before downloading them.

 

 


Re: how to reset the index in solr

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 28, 2009, at 11:33 PM, Geetha wrote:

> Thank you Erik..
>
> Should I write the below code in rake task /lib/tasks/solr.rake?

There's a start to some Solr Rake tasks in solr-ruby's lib/solr/ 
solrtasks.rb.

> I am newbie to ruby.

Welcome!   It's a fun fun world to be in :)

	Erik


Re: how to reset the index in solr

Posted by Geetha <ge...@angleritech.com>.
Thank you Erik..

Should I write the below code in rake task /lib/tasks/solr.rake?

I am newbie to ruby.


Erik Hatcher wrote:
>
> On Apr 24, 2009, at 1:54 AM, sagi4 wrote:
>> Can i get the rake task for clearing the index of solr, I mean "rake
>> index::rebuild", It would be very helpful and also to avoid the 
>> delete id by
>> manually.
>
> How do you currently build your index?
>
> But making a Rake task to do perform Solr operations is generally 
> pretty trivial.  In Ruby (after gem install solr-ruby):
>
>    require 'solr'
>    solr = Solr::Connection.new("http://localhost:8983/solr")
>    solr.optimize  # for example
>
>     Erik
>
>




Re: how to reset the index in solr

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 24, 2009, at 1:54 AM, sagi4 wrote:
> Can i get the rake task for clearing the index of solr, I mean "rake
> index::rebuild", It would be very helpful and also to avoid the  
> delete id by
> manually.

How do you currently build your index?

But making a Rake task to do perform Solr operations is generally  
pretty trivial.  In Ruby (after gem install solr-ruby):

    require 'solr'
    solr = Solr::Connection.new("http://localhost:8983/solr")
    solr.optimize  # for example

	Erik


Re: how to reset the index in solr

Posted by sagi4 <ge...@angleritech.com>.
Thanks for your valuable suggestions.

Can i get the rake task for clearing the index of solr, I mean "rake
index::rebuild", It would be very helpful and also to avoid the delete id by
manually.

regards,
Sg..


Otis Gospodnetic wrote:
> 
> 
> You can also delete it with "delete by query" using the following query in
> the delete command: *:*
> 
> 
> Otis --
> Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
> 
> 
> 
> ----- Original Message ----
>> From: sagi4 <ge...@angleritech.com>
>> To: solr-user@lucene.apache.org
>> Sent: Wednesday, April 22, 2009 7:57:50 AM
>> Subject: Re: how to reset the index in solr
>> 
>> 
>> Thanks for your response.
>> 
>> I want to clear it basically, it means clearing the index
>> 
>> Thank you
>> Sg.. 
>> 
>> 
>> 
>> What do you mean? To delete it or to reload it?
>> If you want to delete it just delete ./data/index folder.
>> 
>> If you want to reload just reload your server if you can.
>> 
>> In case you are using cores you can just reload a core with all it's
>> configuration
>> http://localhost:8080/solr/admin/cores?action=RELOAD&core=core_name
>> 
>> 
>> I need to clearing the index in solr.
>> 
>> I would appreciate anyone help
>> -- 
>> 
>> Best Regards,
>> ** 
>> *Geetha  S *
>> 
>> 
>> 
>> 
>> -- 
>> View this message in context: 
>> http://www.nabble.com/how-to-reset-the-index-in-solr-tp23170853p23174806.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/how-to-reset-the-index-in-solr-tp23170853p23210349.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: how to reset the index in solr

Posted by Otis Gospodnetic <ot...@yahoo.com>.
You can also delete it with "delete by query" using the following query in the delete command: *:*


Otis --
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----
> From: sagi4 <ge...@angleritech.com>
> To: solr-user@lucene.apache.org
> Sent: Wednesday, April 22, 2009 7:57:50 AM
> Subject: Re: how to reset the index in solr
> 
> 
> Thanks for your response.
> 
> I want to clear it basically, it means clearing the index
> 
> Thank you
> Sg.. 
> 
> 
> 
> What do you mean? To delete it or to reload it?
> If you want to delete it just delete ./data/index folder.
> 
> If you want to reload just reload your server if you can.
> 
> In case you are using cores you can just reload a core with all it's
> configuration
> http://localhost:8080/solr/admin/cores?action=RELOAD&core=core_name
> 
> 
> I need to clearing the index in solr.
> 
> I would appreciate anyone help
> -- 
> 
> Best Regards,
> ** 
> *Geetha  S *
> 
> 
> 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/how-to-reset-the-index-in-solr-tp23170853p23174806.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: how to reset the index in solr

Posted by sagi4 <ge...@angleritech.com>.
Thanks for your response.

I want to clear it basically, it means clearing the index

Thank you
Sg.. 



What do you mean? To delete it or to reload it?
If you want to delete it just delete ./data/index folder.

If you want to reload just reload your server if you can.

In case you are using cores you can just reload a core with all it's
configuration
http://localhost:8080/solr/admin/cores?action=RELOAD&core=core_name


I need to clearing the index in solr.

I would appreciate anyone help
-- 

Best Regards,
** 
*Geetha  S *
 



-- 
View this message in context: http://www.nabble.com/how-to-reset-the-index-in-solr-tp23170853p23174806.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: how to reset the index in solr

Posted by Marc Sturlese <ma...@gmail.com>.
What do you mean? To delete it or to reload it?
If you want to delete it just delete ./data/index folder.

If you want to reload just reload your server if you can.

In case you are using cores you can just reload a core with all it's
configuration
http://localhost:8080/solr/admin/cores?action=RELOAD&core=core_name


sagi4 wrote:
> 
> I need to clearing the index in solr.
> 
> I would appreciate anyone help
> -- 
> 
> Best Regards,
> ** 
> *Geetha  S *| System and Software Engineer
> email: geetha@angleritech.com <ma...@angleritech.com>
> 
> *
> Visit us at ICT Expo, HongKong (13th-16th Apr 2009) and Internet World, 
> UK (28-30 Apr 2009)*
> 
> *Click here for FREE TICKETS: 
> *http://www.angleritech.com/company/latest-technology-news-events.html
> 
>  
> 
> *ANGLER Technologies India - Your Offshore Development Partner -- An ISO 
> 9001 Company*
> 
> Contact us for your high quality Software Outsourcing 
> <http://www.angleritech.com/offshore/outsourced_product_development.html>, 
> E-Business Products <http://www.angleritech.com/ebusiness/index.html> 
> and Design Solutions <http://www.angleritech.com/design/index.html>
> 
> /* */
> 
> web         :    www.angleritech.com <http://www.angleritech.com/>
> tel           :    +91 422 2312707, 2313938
> fax           :    +91 422 2313936
> address   :*    *1144 Trichy Road, Coimbatore, 641045, India
> 
> offices <http://www.angleritech.com/contact/index.html>_ _     :  
>   India | USA | UK | Canada | Europe | UAE | South Africa | Singapore | 
> Hong Kong
> 
> * *
> 
> *Disclaimer: *The information in the email, files and communication are 
> strictly confidential and meant for the intended recipients. It may 
> contain proprietary information. If you are not an intended recipient; 
> any form of disclosure, copyright, distribution and any other means of 
> use of information is unauthorised and subject to legal implications. We 
> do not accept any liability for the transmission of incomplete, delayed 
> communication and recipients must check this email and any attachments 
> for the presence of viruses before downloading them.
> 
>  
> 
>  
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/how-to-reset-the-index-in-solr-tp23170853p23171473.html
Sent from the Solr - User mailing list archive at Nabble.com.