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 KRIS MUSSHORN <mu...@comcast.net> on 2016/09/19 15:22:42 UTC

script to get core num docs

How can i get the count of docs from a core with bash? 
Seems like I have to call Admin/Luke but cant find any specifics. 
Thanks 
Kris 

RE: script to get core num docs

Posted by Kris Musshorn <mu...@comcast.net>.
Thanks David.. got it working

-----Original Message-----
From: David Santamauro [mailto:david.santamauro@gmail.com] 
Sent: Monday, September 19, 2016 11:55 AM
To: solr-user@lucene.apache.org
Cc: david.santamauro@gmail.com
Subject: Re: script to get core num docs


https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API

wget -O- -q \
 
'<your-instance>/admin/cores?action=STATUS&core=coreName&wt=json&indent=true' 
\

   | grep numDocs

//


/admin/cores?action=STATUS&core=alexandria_shard2_replica1&wt=json&indent=1'|grep 
numDocs|cut -f2 -d':'|

On 09/19/2016 11:22 AM, KRIS MUSSHORN wrote:
> How can i get the count of docs from a core with bash?
> Seems like I have to call Admin/Luke but cant find any specifics.
> Thanks
> Kris
>


Re: script to get core num docs

Posted by David Santamauro <da...@gmail.com>.
https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API

wget -O- -q \
 
'<your-instance>/admin/cores?action=STATUS&core=coreName&wt=json&indent=true' 
\

   | grep numDocs

//


/admin/cores?action=STATUS&core=alexandria_shard2_replica1&wt=json&indent=1'|grep 
numDocs|cut -f2 -d':'|

On 09/19/2016 11:22 AM, KRIS MUSSHORN wrote:
> How can i get the count of docs from a core with bash?
> Seems like I have to call Admin/Luke but cant find any specifics.
> Thanks
> Kris
>

Re: script to get core num docs

Posted by Walter Underwood <wu...@wunderwood.org>.
Do a search. The URL will looks something like this:

   /solr/core-name/select?q=*:*&rows=0&wt=json

That will return something like this:

   {"responseHeader":{"status":0,"QTime":1},"response":{"numFound":287176,"start":0,"docs":[]}}

Filter that response through this:

   jq .response.numFound

And you’ll get the number of documents in the core.

Alternatively, the info is in the admin status API.

wunder
Walter Underwood
wunder@wunderwood.org
http://observer.wunderwood.org/  (my blog)


> On Sep 19, 2016, at 8:30 AM, John Bickerstaff <jo...@johnbickerstaff.com> wrote:
> 
> I would imagine there's an http call that would get it and you could call
> cURL in your bash script...  I don't know the URL parameters off hand
> however...
> 
> On Mon, Sep 19, 2016 at 9:22 AM, KRIS MUSSHORN <mu...@comcast.net>
> wrote:
> 
>> How can i get the count of docs from a core with bash?
>> Seems like I have to call Admin/Luke but cant find any specifics.
>> Thanks
>> Kris
>> 


Re: script to get core num docs

Posted by John Bickerstaff <jo...@johnbickerstaff.com>.
I would imagine there's an http call that would get it and you could call
cURL in your bash script...  I don't know the URL parameters off hand
however...

On Mon, Sep 19, 2016 at 9:22 AM, KRIS MUSSHORN <mu...@comcast.net>
wrote:

> How can i get the count of docs from a core with bash?
> Seems like I have to call Admin/Luke but cant find any specifics.
> Thanks
> Kris
>

Re: script to get core num docs

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
If you see it in the Admin UI (and you do), you can get it from the
web browser's Developer interface but just reloading the page and
watching for traffic.

Is that enough for you to discover what you need or do you need more
specific help?

Regards,
   Alex.
----
Newsletter and resources for Solr beginners and intermediates:
http://www.solr-start.com/


On 19 September 2016 at 22:22, KRIS MUSSHORN <mu...@comcast.net> wrote:
> How can i get the count of docs from a core with bash?
> Seems like I have to call Admin/Luke but cant find any specifics.
> Thanks
> Kris