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 "Fink, Clayton R." <Cl...@jhuapl.edu> on 2009/04/02 23:29:38 UTC

Remote Access To Schema Data

Hi:

I want to get a list of the fields and field types for an index deployed on a Solr server (over HTTP or embedded). I can't see any obvious way to do this as a client.

This is part of the use case for an app we are working on where all field information for an index is available and we can programmatically format updates and queries based on the available fields.

Thanks,

Clay Fink


RE: Remote Access To Schema Data

Posted by "Fink, Clayton R." <Cl...@jhuapl.edu>.
The LukeRequest class gets me what I wanted. Thanks! 

-----Original Message-----
From: Shalin Shekhar Mangar [mailto:shalinmangar@gmail.com] 
Sent: Friday, April 03, 2009 10:15 AM
To: solr-user@lucene.apache.org
Subject: Re: Remote Access To Schema Data

On 4/3/09, Erik Hatcher <er...@ehatchersolutions.com> wrote:
>
> On Apr 3, 2009, at 9:26 AM, Shalin Shekhar Mangar wrote:
>> Note that the luke handler gives out a lot of information like term 
>> frequency and therefore takes a longer time to execute.
>
> It's fast if you say &numTerms=0 though, which is good enough to get 
> field/type info.

Nice. I didn't know that. Thanks Erik.

--
Regards,
Shalin Shekhar Mangar.

Re: Remote Access To Schema Data

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On 4/3/09, Erik Hatcher <er...@ehatchersolutions.com> wrote:
>
> On Apr 3, 2009, at 9:26 AM, Shalin Shekhar Mangar wrote:
>> Note that the luke handler gives out a lot of information like term
>> frequency and therefore takes a longer time to execute.
>
> It's fast if you say &numTerms=0 though, which is good enough to get
> field/type info.

Nice. I didn't know that. Thanks Erik.

-- 
Regards,
Shalin Shekhar Mangar.

Re: Remote Access To Schema Data

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 3, 2009, at 9:26 AM, Shalin Shekhar Mangar wrote:
> Note that the luke handler gives out a lot of information like term
> frequency and therefore takes a longer time to execute.

It's fast if you say &numTerms=0 though, which is good enough to get  
field/type info.

	Erik


Re: Remote Access To Schema Data

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, Apr 3, 2009 at 6:11 PM, Fink, Clayton R. <Cl...@jhuapl.edu>wrote:

> Thanks, Jeff.
>
> Luke will work , but it's a GUI - unless they expose an API that I can
> call. What I need is a way to get the informatiom as a client call to a
> SolrJ SolrServer object. We want to be able to get this info whether we are
> running Solr embedded or as a Web service. I guess I could write a request
> handler to return this info, but I like to see what's the "right" way to do
> this.
>

Hit /admin/luke to get luke's output as an XML which you can parse. You can
also hit /admin/file/?file=schema.xml. If you are using Solrj, you'd need to
set qt=/admin/luke or qt=/admin/file for this to work.

Note that the luke handler gives out a lot of information like term
frequency and therefore takes a longer time to execute.

-- 
Regards,
Shalin Shekhar Mangar.

RE: Remote Access To Schema Data

Posted by "Fink, Clayton R." <Cl...@jhuapl.edu>.
Thanks, Jeff.

Luke will work , but it's a GUI - unless they expose an API that I can call. What I need is a way to get the informatiom as a client call to a SolrJ SolrServer object. We want to be able to get this info whether we are running Solr embedded or as a Web service. I guess I could write a request handler to return this info, but I like to see what's the "right" way to do this.

Clay  

-----Original Message-----
From: Jeff Newburn [mailto:jnewburn@zappos.com] 
Sent: Thursday, April 02, 2009 6:14 PM
To: solr-user@lucene.apache.org
Subject: Re: Remote Access To Schema Data

Fastest way I know of to get the schema is using the luke browser.
http://localhost/solr/admin/luke
It returns in xml and has tons of info you probably aren't interested it.
However, it does contain information like fields and type.

--
Jeff Newburn
Software Engineer, Zappos.com
jnewburn@zappos.com - 702-943-7562


> From: "Fink, Clayton R." <Cl...@jhuapl.edu>
> Reply-To: <so...@lucene.apache.org>
> Date: Thu, 2 Apr 2009 17:29:38 -0400
> To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
> Subject: Remote Access To Schema Data
> 
> Hi:
> 
> I want to get a list of the fields and field types for an index deployed on a
> Solr server (over HTTP or embedded). I can't see any obvious way to do this as
> a client.
> 
> This is part of the use case for an app we are working on where all field
> information for an index is available and we can programmatically format
> updates and queries based on the available fields.
> 
> Thanks,
> 
> Clay Fink
>  

Re: Remote Access To Schema Data

Posted by Jeff Newburn <jn...@zappos.com>.
Fastest way I know of to get the schema is using the luke browser.
http://localhost/solr/admin/luke
It returns in xml and has tons of info you probably aren't interested it.
However, it does contain information like fields and type.

-- 
Jeff Newburn
Software Engineer, Zappos.com
jnewburn@zappos.com - 702-943-7562


> From: "Fink, Clayton R." <Cl...@jhuapl.edu>
> Reply-To: <so...@lucene.apache.org>
> Date: Thu, 2 Apr 2009 17:29:38 -0400
> To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
> Subject: Remote Access To Schema Data
> 
> Hi:
> 
> I want to get a list of the fields and field types for an index deployed on a
> Solr server (over HTTP or embedded). I can't see any obvious way to do this as
> a client.
> 
> This is part of the use case for an app we are working on where all field
> information for an index is available and we can programmatically format
> updates and queries based on the available fields.
> 
> Thanks,
> 
> Clay Fink
>