lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: add new Fields with SolrJ without changing schema.xml
Date Wed, 18 Jun 2014 15:04:52 GMT
bq: I need to add new Fields with SolrJ without changing schema.xml

You have three options:
1> change the schema.xml file. but you say you can't. Why not?
2> use dynamic fields. If you're lucky, you have the stock schema.xml
and can use them. They'll require some suffix to match the pattern
though.
3> use "managed schemas", the schemaless variant to just try to figure
it out or the managed variant and use the API to add fields before
using them.

But under any circumstance, you probably have to change your configs.

Best,
Erick

On Wed, Jun 18, 2014 at 7:31 AM, benjelloun <anass.bnj@gmail.com> wrote:
> Hello,
>
> I need to add new Fields with SolrJ without changing schema.xml.
> this is my code java :
>
> HttpSolrServer server = new HttpSolrServer("http://localhost:8080/solr");
> SolrInputDocument doc = new SolrInputDocument();
>  doc.addField("id", id);
>  doc.addField("Titre", nomdocument);
>
> the id and Titre are already on schema.xml, but what i need to do id to add
> new fields like  firstname,last name, age...
>
> thanks for help,
> Best regards,
> Anass BENJELLOUN
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/add-new-Fields-with-SolrJ-without-changing-schema-xml-tp4142515.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message