Hi, 

You can use the org.apache.solr.client.solrj.request.schema.SchemaRequest from 
solrj: 

SchemaRequest.AddField addFieldRequest = new 
SchemaRequest.AddField(fieldAttributes);
SchemaResponse.UpdateResponse addFieldResponse = 
addFieldRequest.process(solrClient, collectionName);

Kind regards

> -----Original Message-----
> From: nskarthik <nskarthi...@gmail.com>
> Sent: Sonntag, 10. Oktober 2021 19:02
> To: users@solr.apache.org
> Subject: Re: Solrj for addField for indexing document
> 
> Hi
> 
> I am trying to implement  new Fields as stated in this URL
> https://solr.apache.org/guide/8_1/schema-api.html
> 
> using java code with SolrJ 8.8.1
> 
>  Note: I do not want to use Solr web schema API to do this task and preffer
> java code level to do this job,
> 
>  Request : Please share a sinppet  of code for the same.
> 
> with regards
> 
> 
> 
> On 2021/10/06 09:56:29, KARTHIK SHIVAKUMAR <nskarthi...@gmail.com>
> wrote:
> > Hi
> >
> > Spec : Jdk 15, Solr 8.8.1
> >
> > Question : Can solrj ( client )   be used to add new 'addField' into schema
> for setup so as to index the documents later  instead of getting missing field
> type exception.
> >
> > Note: I do not want to use Solr web schema API to do this task and
> > preffer java code level to do this job,
> >
> > Request : Please share a sinppet  of code for the same.
> >
> >
> > Thx for the same.
> >

Reply via email to