Thank you, embarrassingly I had not looked at that doc.

And thank you to the other repliers.

________________________________________
From: Chris Hostetter <hossman_luc...@fucit.org>
Sent: 22 October 2014 20:38
To: solr-user@lucene.apache.org
Subject: Re: StatelessScriptUpdateProcessorFactory Access to Solr 
Core/schema/analyzer etc

: I am attempting to create a script (java script) using the
: StatelessScriptUpdateProcessorFactory feature of solr but I am blocked
: on how to access the current core instance (ultimately to access it's
: schema)? In the wikipedia example the input document is accessible using
: doc = cmd.solrDoc but no other information is given. The aim of the

Have you looked at the javadocs for the Factory?

https://lucene.apache.org/solr/4_10_0/solr-core/org/apache/solr/update/processor/StatelessScriptUpdateProcessorFactory.html

It notes exactly what objects are in global scope for each script -
notably you have access to the SolrQueryRequest from which you can call
getCore() or getSchema().

It also notes that the methods in each script need to implement the
UpdateRequestProcessor - which means the "cmd" object passed to each
method is an instance of (a subclass of) "UpdateCommand" - so you can also
use cmd.getReq() to access the SolrQueryRequest even if you aren't sure
how to get to global variables in your scripting language you are using.


-Hoss
http://www.lucidworks.com/

Reply via email to