You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by Yonik Seeley <yo...@apache.org> on 2007/09/27 22:34:32 UTC
FieldType access to SolrCore
https://issues.apache.org/jira/browse/SOLR-351
needs the external value source to know the index directory.
The most straightforward way would be to get the core somehow...
Currently, the IndexSchema is created before the SolrCore (with the
recent changes getting rid of a single core/config this means that
nothing instantiated by IndexSchema can use config anymore.
The quickest solution:
After the core is constructed, the IndexSchema could keep a reference
to it. I assume every core will have it's own schema instance.
Thoughts?
-Yonik
Re: FieldType access to SolrCore
Posted by Yonik Seeley <yo...@apache.org>.
On 9/28/07, Chris Hostetter <ho...@fucit.org> wrote:
> : Currently, the IndexSchema is created before the SolrCore (with the
> : recent changes getting rid of a single core/config this means that
> : nothing instantiated by IndexSchema can use config anymore.
>
> this statment confuses me ... the IndexSchema constructed is passed a
> refrence to the SOlrConfig
Indeed... I had missed that change.
> : The quickest solution:
> : After the core is constructed, the IndexSchema could keep a reference
> : to it. I assume every core will have it's own schema instance.
>
> this reminds me of hte issue we had with RequestHandler initialization ...
> it has to be done in two passes, one where placeholders are all recorded,
> and one where they are initalized.
>
> if the IndexSchema must be constructed prior to the core (not clear why
> that's true)
Historical... no real good reason I think.
>, then perhaps the IndexSchema can be constructed before the
> core, but then the core can pass itself as an arg to a new init method on
> the schema (which would trigger all of hte fieldtype initialization,
Just being able to do a getCore() on the schema would be enough for
this current problem.
I can pursue that and we can do deferred fieldtype init later if needed.
-Yonik
Re: FieldType access to SolrCore
Posted by Chris Hostetter <ho...@fucit.org>.
: Currently, the IndexSchema is created before the SolrCore (with the
: recent changes getting rid of a single core/config this means that
: nothing instantiated by IndexSchema can use config anymore.
this statment confuses me ... the IndexSchema constructed is passed a
refrence to the SOlrConfig the reason seems to mainly be for recording
severe errors and constructing new instances of things using the plugin
classloader, but why can't it use it for other stuff as well?
: The quickest solution:
: After the core is constructed, the IndexSchema could keep a reference
: to it. I assume every core will have it's own schema instance.
this reminds me of hte issue we had with RequestHandler initialization ...
it has to be done in two passes, one where placeholders are all recorded,
and one where they are initalized.
if the IndexSchema must be constructed prior to the core (not clear why
that's true), then perhaps the IndexSchema can be constructed before the
core, but then the core can pass itself as an arg to a new init method on
the schema (which would trigger all of hte fieldtype initialization,
etc...)
...isn't there a design pattern name for that idea?
-Hoss
Re: FieldType access to SolrCore
Posted by Yonik Seeley <yo...@apache.org>.
On 9/27/07, Yonik Seeley <yo...@apache.org> wrote:
> https://issues.apache.org/jira/browse/SOLR-351
> needs the external value source to know the index directory.
> The most straightforward way would be to get the core somehow...
>
> Currently, the IndexSchema is created before the SolrCore (with the
> recent changes getting rid of a single core/config this means that
> nothing instantiated by IndexSchema can use config anymore.
>
> The quickest solution:
> After the core is constructed, the IndexSchema could keep a reference
> to it. I assume every core will have it's own schema instance.
Another possibility that would be helpful in some circumstances would
be somehow getting the SolrIndexSearcher (which has a reference to
core) associated with the IndexReader that is used at the lower level
in scorers and value sources.
-Yonik