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 Rakhi Khatwani <rk...@gmail.com> on 2010/06/08 12:39:09 UTC

IndexSchema from CommonsHttpSolrServer

Hi,
          Is there any way to create an IndexSchema from a
CommonsHttpSolrServer. (where u don't know the location of schema.xml and
solrconfig.xml or those files are in some other machine.)

I tried looking for solrJ api's for the same. but coudn't find it.

or is there any way to retrieve schema file from the index using solrj?
schema.xml file can be retrieved from
http://localhost:8983/solr/CoreX/admin/file/?file=schema.xml

Any Pointers???

Regards,
Raakhi

Re: IndexSchema from CommonsHttpSolrServer

Posted by Lance Norskog <go...@gmail.com>.
To get the schema.xml file, look at how Solr's admin/index.jsp fetches
it under the "Schema" button.

You cannot get a nice, cleanly parsed schema object tree from SolrJ.

On Tue, Jun 8, 2010 at 5:16 AM, Peter Karich <pe...@yahoo.de> wrote:
> Hi Raakhi,
>
> I am not sure if I understand your usecase correctly,
> but if you need this custom location to test against an
> existing schema/config file I found this snippet [1].
>
> Otherwise the solr home can be set with
>
> -Dsolr.solr.home=/opt/solr/example"
>
> more information is available here [2]
>
> Regards,
> Peter.
>
> [1]
> public class SolrTest extends AbstractSolrTestCase {
>
>    @Override
>    public String getSchemaFile() {
>        return "solr/conf/schema.xml";
>    }
>
>    @Override
>    public String getSolrConfigFile() {
>        return "solr/conf/solrconfig.xml";
>    }
>
>    @Before
>    @Override
>    public void setUp() throws Exception {
>        super.setUp();
>
>        server = new EmbeddedSolrServer(h.getCoreContainer(),
> h.getCore().getName());
>    }
>
>    @After
>    @Override
>    public void tearDown() throws Exception {
>        super.tearDown();
>    }
> ...
>
> [2]
> http://wiki.apache.org/solr/SolrTomcat
>
>> Hi,
>>           Is there any way to create an IndexSchema from a
>> CommonsHttpSolrServer. (where u don't know the location of schema.xml and
>> solrconfig.xml or those files are in some other machine.)
>>
>> I tried looking for solrJ api's for the same. but coudn't find it.
>>
>> or is there any way to retrieve schema file from the index using solrj?
>> schema.xml file can be retrieved from
>> http://localhost:8983/solr/CoreX/admin/file/?file=schema.xml
>>
>> Any Pointers???
>>
>> Regards,
>> Raakhi
>>
>>
>
>



-- 
Lance Norskog
goksron@gmail.com

Re: IndexSchema from CommonsHttpSolrServer

Posted by Peter Karich <pe...@yahoo.de>.
Hi Raakhi,

I am not sure if I understand your usecase correctly,
but if you need this custom location to test against an
existing schema/config file I found this snippet [1].

Otherwise the solr home can be set with

-Dsolr.solr.home=/opt/solr/example"

more information is available here [2]

Regards,
Peter.

[1]
public class SolrTest extends AbstractSolrTestCase {   

    @Override
    public String getSchemaFile() {
        return "solr/conf/schema.xml";
    }

    @Override
    public String getSolrConfigFile() {
        return "solr/conf/solrconfig.xml";
    }

    @Before
    @Override
    public void setUp() throws Exception {
        super.setUp();       

        server = new EmbeddedSolrServer(h.getCoreContainer(),
h.getCore().getName());       
    }

    @After
    @Override
    public void tearDown() throws Exception {
        super.tearDown();       
    }
...

[2]
http://wiki.apache.org/solr/SolrTomcat

> Hi,
>           Is there any way to create an IndexSchema from a
> CommonsHttpSolrServer. (where u don't know the location of schema.xml and
> solrconfig.xml or those files are in some other machine.)
>
> I tried looking for solrJ api's for the same. but coudn't find it.
>
> or is there any way to retrieve schema file from the index using solrj?
> schema.xml file can be retrieved from
> http://localhost:8983/solr/CoreX/admin/file/?file=schema.xml
>
> Any Pointers???
>
> Regards,
> Raakhi
>
>