You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by so...@cid.is on 2023/03/20 13:57:22 UTC

Solr @ Windows 10: how to delete an index

Hi all,

I have to run a Solr project on a Windows 10 PC.
Everything went fine.
But now I have to delete an existing index, and neither the *ix  
command nor some "googled" Windows commands work.

This works fine on *ix:

curl 'http://localhost:8983/solr/my_core/update?commit=true' -d  
'<delete><query>*:*</query></delete>'

These 2 do not work on Windows:

1) C:\solr-9.1.1> java -Dc=my_core -Drecursive=yes -Dauto -jar  
example\exampledocs\post.jar '<delete><query>*:*</query></delete>'

SimplePostTool version 5.0.0
Posting files to [base] url http://localhost:8983/solr/core_qst_2023/update...
Entering auto mode. File endings considered are  
xml,json,jsonl,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log
Entering recursive mode, max depth=999, delay=0s
SimplePostTool: WARNING: No files or directories matching  
<delete><query>*:*<\query><\delete>
0 files indexed.
COMMITting Solr index changes to  
http://localhost:8983/solr/core_qst_2023/update...
Time spent: 0:00:00.497

2) PS C:\solr-9.1.1> java -Dc=my_core bin\post  
'<delete><query>*:*</query></delete>'

Error: Main Class bin\post could not be found or loaded (my  
translation from german)
Reason: java.lang.ClassNotFoundException: bin\post

Any idea on this?
Is there an *actual* manual / tutorial for Solr on Windows?

Thanks
Walter Claassen


Re: Re: Solr @ Windows 10: how to delete an index

Posted by so...@cid.is.
Jan & Shawn,
thank you for your quick response.
I used (and shall use) Jan's proposal to form Admin UI "Documents" screen.
Walter


"Jan Høydahl" <ja...@cominvent.com> schrieb am 20.03.2023 19:03:48:

> Von: "Jan Høydahl" <ja...@cominvent.com>
> An: users@solr.apache.org
> Datum: 20.03.2023 19:05
> Betreff: Re: Solr @ Windows 10: how to delete an index
> 
> java -jar example\exampledocs\post.jar -h
> 
> Or form Admin UI "Documents" screen
> 
> http://localhost:8983/solr/#/my_core/documents
> Change to XML and paste <delete><query>*:*</query></delete> into the box
> 
> Jan


"Shawn Heisey" <ap...@elyograg.org> schrieb am 20.03.2023 19:07:10:

> Von: "Shawn Heisey" <ap...@elyograg.org>
> An: users@solr.apache.org
> Datum: 20.03.2023 19:10
> Betreff: Re: Solr @ Windows 10: how to delete an index
> 
> On 3/20/23 07:57, solr@cid.is wrote:
> > This works fine on *ix:
> > 
> > curl 'http://localhost:8983/solr/my_core/update?commit=true' -d 
> > '<delete><query>*:*</query></delete>'
> > 
> > These 2 do not work on Windows:
> > 
> > 1) C:\solr-9.1.1> java -Dc=my_core -Drecursive=yes -Dauto -jar 
> > example\exampledocs\post.jar '<delete><query>*:*</query></delete>'
> 
> > 2) PS C:\solr-9.1.1> java -Dc=my_core bin\post 
> > '<delete><query>*:*</query></delete>'
> 
> 
> The SimplePostTool is designed for indexing FILES to Solr, not a text 
> string.  It is trying to interpret that XML data as a filename.
> 
> If you put that XML content into a file with an xml extension and run 
> command number 1 with the path to that file instead of the xml data in 
> single quotes, it will work.
> 
> Command number 2 is invalid.  Wherever you saw that is sharing incorrect 

> information.
> 
> Or you can use curl on Windows.
> 
> Windows 10 and later come with curl.  But it has very different options 
> compared to "standard" curl, and I haven't worked out how to change it 
> to work with that command.
> 
> If you install Git for Windows, then you can run Git Bash and use curl 
> in that prompt just like you're used to on *NIX platforms.  It even 
> includes perl.
> 
> Or you can get curl for Windows.  https://curl.se/windows/
> 
> Thanks,
> Shawn


Re: Solr @ Windows 10: how to delete an index

Posted by Shawn Heisey <ap...@elyograg.org>.
On 3/20/23 07:57, solr@cid.is wrote:
> This works fine on *ix:
> 
> curl 'http://localhost:8983/solr/my_core/update?commit=true' -d 
> '<delete><query>*:*</query></delete>'
> 
> These 2 do not work on Windows:
> 
> 1) C:\solr-9.1.1> java -Dc=my_core -Drecursive=yes -Dauto -jar 
> example\exampledocs\post.jar '<delete><query>*:*</query></delete>'

> 2) PS C:\solr-9.1.1> java -Dc=my_core bin\post 
> '<delete><query>*:*</query></delete>'


The SimplePostTool is designed for indexing FILES to Solr, not a text 
string.  It is trying to interpret that XML data as a filename.

If you put that XML content into a file with an xml extension and run 
command number 1 with the path to that file instead of the xml data in 
single quotes, it will work.

Command number 2 is invalid.  Wherever you saw that is sharing incorrect 
information.

Or you can use curl on Windows.

Windows 10 and later come with curl.  But it has very different options 
compared to "standard" curl, and I haven't worked out how to change it 
to work with that command.

If you install Git for Windows, then you can run Git Bash and use curl 
in that prompt just like you're used to on *NIX platforms.  It even 
includes perl.

Or you can get curl for Windows.  https://curl.se/windows/

Thanks,
Shawn

Re: Solr @ Windows 10: how to delete an index

Posted by Jan Høydahl <ja...@cominvent.com>.
java -jar example\exampledocs\post.jar -h

Or form Admin UI "Documents" screen

http://localhost:8983/solr/#/my_core/documents
Change to XML and paste <delete><query>*:*</query></delete> into the box

Jan


> 20. mar. 2023 kl. 14:57 skrev solr@cid.is:
> 
> Hi all,
> 
> I have to run a Solr project on a Windows 10 PC.
> Everything went fine.
> But now I have to delete an existing index, and neither the *ix command nor some "googled" Windows commands work.
> 
> This works fine on *ix:
> 
> curl 'http://localhost:8983/solr/my_core/update?commit=true' -d '<delete><query>*:*</query></delete>'
> 
> These 2 do not work on Windows:
> 
> 1) C:\solr-9.1.1> java -Dc=my_core -Drecursive=yes -Dauto -jar example\exampledocs\post.jar '<delete><query>*:*</query></delete>'
> 
> SimplePostTool version 5.0.0
> Posting files to [base] url http://localhost:8983/solr/core_qst_2023/update...
> Entering auto mode. File endings considered are xml,json,jsonl,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log
> Entering recursive mode, max depth=999, delay=0s
> SimplePostTool: WARNING: No files or directories matching <delete><query>*:*<\query><\delete>
> 0 files indexed.
> COMMITting Solr index changes to http://localhost:8983/solr/core_qst_2023/update...
> Time spent: 0:00:00.497
> 
> 2) PS C:\solr-9.1.1> java -Dc=my_core bin\post '<delete><query>*:*</query></delete>'
> 
> Error: Main Class bin\post could not be found or loaded (my translation from german)
> Reason: java.lang.ClassNotFoundException: bin\post
> 
> Any idea on this?
> Is there an *actual* manual / tutorial for Solr on Windows?
> 
> Thanks
> Walter Claassen
>