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
>
>   

Reply via email to