API to get index info

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

API to get index info

John Wang-9
Can we have an API that exposes index information, e.g. number of segments
etc.? (or simply make SegmentInfo(s) public classes)
We currently do this by working around package-level protecting  by sneaking
in a subclass in the org.apache.index package. We are moving towards OSGI,
and split-packages is a no no.

Thanks

-John
Reply | Threaded
Open this post in threaded view
|

Re: API to get index info

Yonik Seeley-2-2
On Tue, Mar 31, 2009 at 3:43 PM, John Wang <[hidden email]> wrote:
> Can we have an API that exposes index information, e.g. number of segments
> etc.?

Should already all be obtainable via public access:
IndexReader.getSequentialSubReaders() and
IndexReader.getIndexCommit()


-Yonik
http://www.lucidimagination.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: API to get index info

John Wang-9
Maybe I am missing something. I don't see any calls that would gimme the
number of segments. Are you suggesting: IndexCommit.getFileNames().size()?

Thanks

-John

On Tue, Mar 31, 2009 at 1:04 PM, Yonik Seeley <[hidden email]>wrote:

> On Tue, Mar 31, 2009 at 3:43 PM, John Wang <[hidden email]> wrote:
> > Can we have an API that exposes index information, e.g. number of
> segments
> > etc.?
>
> Should already all be obtainable via public access:
> IndexReader.getSequentialSubReaders() and
> IndexReader.getIndexCommit()
>
>
> -Yonik
> http://www.lucidimagination.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: API to get index info

Yonik Seeley-2-2
On Tue, Mar 31, 2009 at 4:55 PM, John Wang <[hidden email]> wrote:
> Maybe I am missing something. I don't see any calls that would gimme the
> number of segments. Are you suggesting: IndexCommit.getFileNames().size()?

IndexReader.getSequentialSubReaders().length

The stats page of Solr now displays the number of segments in the
current index using this.

-Yonik
http://www.lucidimagination.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: API to get index info

John Wang-9
Excellent!

Thanks

-John

On Tue, Mar 31, 2009 at 2:25 PM, Yonik Seeley <[hidden email]>wrote:

> On Tue, Mar 31, 2009 at 4:55 PM, John Wang <[hidden email]> wrote:
> > Maybe I am missing something. I don't see any calls that would gimme the
> > number of segments. Are you suggesting:
> IndexCommit.getFileNames().size()?
>
> IndexReader.getSequentialSubReaders().length
>
> The stats page of Solr now displays the number of segments in the
> current index using this.
>
> -Yonik
> http://www.lucidimagination.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>