There are 3 approaches I can think of:

1. You can generate a new data-config.xml for each import.  With Solr 4.0 and 
later, DIH re-parses your data-config.xml and picks up any changes 
automatically.
2. You can parameterize nearly anything in data-config.xml, add the parameters 
to your request URL like:
/solr/dataimport?command=full-import&key=value
...then use ${dataimporter.request.key} in your data-config.xml

3. You can put optional sections into sql queries, then use parameters to 
insert comment strings:
/solr/dataimport?command=full-import&openComment=/*&closeComment=*/
<entity query="
 select id, 
something${dataimporter.request.openComment},optionalStuff${dataimporter.request.closeComment}
 from foo
"/>

Not sure if this is the answer to your question.  If not, give more details.

James Dyer
Ingram Content Group
(615) 213-4311

-----Original Message-----
From: kobe.free.wo...@gmail.com [mailto:kobe.free.wo...@gmail.com] 
Sent: Monday, March 18, 2013 4:03 AM
To: solr-user@lucene.apache.org
Subject: SOLR - Define fields in DIH configuration file dynamically

Hello All,

Is there a way to manage (add/ remove) fields in the data import handler
configuration file dynamically through any API/ Library like SolrNet?

Thanks



--
View this message in context: 
http://lucene.472066.n3.nabble.com/SOLR-Define-fields-in-DIH-configuration-file-dynamically-tp4048465.html
Sent from the Solr - User mailing list archive at Nabble.com.


Reply via email to