You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Per Fredelius <pe...@gmail.com> on 2012/12/05 17:51:11 UTC
How to make a plugin SchemaAware or XAware, runtime wise? (Solr 3.6.1)
So I'm creating a request handler plugin where I want to fetch some values
from the schema. I make it SchemaAware but the inform method is never
called. I assume that there is some way of registering the instance as
aware (and I have seen and used this before, although that information
escapes me at this point). I can't find any documentation on this in
particular and neither can I find any calls doing this in the solr
source<https://github.com/apache/lucene-solr/blob/branch_3x/solr/core/src/java/org/apache/solr/schema/CurrencyField.java>.
But this could very well be done outside the
So, is there some procedure for initiating getting inform calls?
/Thanks :)
Re: How to make a plugin SchemaAware or XAware, runtime wise? (Solr
3.6.1)
Posted by Chris Hostetter <ho...@fucit.org>.
: I'm sorry, I don't see how the resource loader awareness is relevant to
: schema awareness? Or perhaps you didn't imply that? Good to know about the
No, my mistake ... typed one when i ment the other one.
: I guess I use the core to get to the schema then. Hmm, I may recall trying
: that at some point but that I hit some problem with that, something like
: the schema not being present when getting core inform call.
the schema (and the rest of the SolrCore) should be fully constructed and
populated by the time inform(SolrCore) is called -- that's the entire
point of these "FooAware" interfaces and the delayed "inform(Foo)" about
the them.
-Hoss
Re: How to make a plugin SchemaAware or XAware, runtime wise? (Solr 3.6.1)
Posted by Per Fredelius <pe...@gmail.com>.
I'm sorry, I don't see how the resource loader awareness is relevant to
schema awareness? Or perhaps you didn't imply that? Good to know about the
resource loader though. Although I'm not sure what the resource loader does
at this point (but that's a side track).
I guess I use the core to get to the schema then. Hmm, I may recall trying
that at some point but that I hit some problem with that, something like
the schema not being present when getting core inform call.
/Per
2012/12/5 Chris Hostetter <ho...@fucit.org>
>
> : So I'm creating a request handler plugin where I want to fetch some
> values
> : from the schema. I make it SchemaAware but the inform method is never
> : called. I assume that there is some way of registering the instance as
> : aware (and I have seen and used this before, although that information
> : escapes me at this point). I can't find any documentation on this in
>
> http://wiki.apache.org/solr/SolrPlugins#Building_Plugins
>
> Because of lifecycle complexities, not all plugins can be
> "ResourceLoaderAware" or "SolrCoreAware".
>
> If you want to initialize your RequestHandler with information from the
> ResourceLoader, just make it SolrCoreAware and then in your
> inform(SolrCore core) method you can call core.getResourceLoader().
>
>
> -Hoss
>
Re: How to make a plugin SchemaAware or XAware, runtime wise? (Solr
3.6.1)
Posted by Chris Hostetter <ho...@fucit.org>.
: So I'm creating a request handler plugin where I want to fetch some values
: from the schema. I make it SchemaAware but the inform method is never
: called. I assume that there is some way of registering the instance as
: aware (and I have seen and used this before, although that information
: escapes me at this point). I can't find any documentation on this in
http://wiki.apache.org/solr/SolrPlugins#Building_Plugins
Because of lifecycle complexities, not all plugins can be
"ResourceLoaderAware" or "SolrCoreAware".
If you want to initialize your RequestHandler with information from the
ResourceLoader, just make it SolrCoreAware and then in your
inform(SolrCore core) method you can call core.getResourceLoader().
-Hoss