lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Georg Sorst <g.so...@findologic.com>
Subject Set Config API user properties with SolrJ
Date Sat, 09 Apr 2016 23:49:37 GMT
Hi,

how can you set Config API values from SolrJ? Does anyone have an example
for this?

Here's what I'm currently trying:

/* Build the structure for the request */
Map<String, String> parameters = new HashMap<String, String>() {{
  put("key", "value");
}};
final NamedList<Object> requestParameters = new NamedList<>();
requestParameters.add("set-user-property", parameters);

/* Build the JSON */
CharArr json = new CharArr();
new SchemaRequestJSONWriter(json).write(requestParameters);
ContentStreamBase.StringStream stringStream = new
ContentStreamBase.StringStream(json.toString());
Collection<ContentStream> contentStreams = Collections.<ContentStream>
singletonList(stringStream);

/* Send the request */
GenericSolrRequest request = new
GenericSolrRequest(SolrRequest.METHOD.POST, "/config/overlay", null);
request.setContentStreams(contentStreams);
SimpleSolrResponse response = request.process(new HttpSolrClient("
http://localhost:8983/solr/test"));

The JSON is looking good, but it's doing... nothing. The response just
contains the default config-overlay contents (znodeVersion). Any idea why?

Thanks!
Georg
-- 
*Georg M. Sorst I CTO*
FINDOLOGIC GmbH



Jakob-Haringer-Str. 5a | 5020 Salzburg I T.: +43 662 456708
E.: g.sorst@findologic.com
www.findologic.com Folgen Sie uns auf: XING
<https://www.xing.com/profile/Georg_Sorst>facebook
<https://www.facebook.com/Findologic> Twitter
<https://twitter.com/findologic>

Wir sehen uns auf dem *Shopware Community Day in Ahaus am 20.05.2016!* Hier
<beratung@findologic.com?subject=Terminvereinbarung%20SCD> Termin
vereinbaren!
Wir sehen uns auf der* dmexco in Köln am 14.09. und 15.09.2016!* Hier
<beratung@findologic.com?subject=Terminvereinbarung%20dmexco> Termin
vereinbaren!

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message