lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom LAMPERT <t.lamp...@laboquantup.eu>
Subject Re: StatelessScriptUpdateProcessorFactory Access to Solr Core/schema/analyzer etc
Date Wed, 22 Oct 2014 21:35:24 GMT
Thank you, embarrassingly I had not looked at that doc.

And thank you to the other repliers.

________________________________________
From: Chris Hostetter <hossman_lucene@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/
Mime
View raw message