[
https://issues.apache.org/jira/browse/SOLR-1067?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12681034#action_12681034
]
Hoss Man commented on SOLR-1067:
--------------------------------
to followup on a comment i made in that email thread...
{quote}
The sanest thing to do would probably be to make parseFunction construct a
local instance of FunctionQParser (with a null SolrQueryRequest) instead
of using QParser.getParser(...). that should be fairly close to the way
it worked in older versions
(hmmm... except FunctionQParser does something similar to get a
ValueSourceParser ... a new constructor for FunctionQParser that
explicitly tells it to use ValueSourceParser.standardValueSourceParsers
might be in order).
I think it goes without saying that QueryParsing.parseFunction should be
deprecated as well ... fortunately it's only used in a few places in the
core code ... unfortunately those places also don't currently have access
to a SolrQueryRequest at the moment:
1) SolrPluginUtils.parseFuncs -- should probably be deprecated, callers
of it should start using the QParser APIs.
2) SolrQueryParser.getFieldQuery -- it's only used if the
SolrQueryParser was constructed with an IndexSchema and not with a QParser
(in which case it can ask the QParser for a subParser) .. the IndexSchema
constructor should probably be deprecated as well (but i haven't dug in to
see how far down the rabit hole that change would go)
{quote}
If we gave FunctionQParser a constructor that took in an IndexSchema instead of
a SolrQueryRequest, then that new constructor could be used by both
QueryParsing.parseFunction and SolrQueryParser.getFieldQuery and -- we'd still
need to use the ValueSourceParser.standardValueSourceParsers as well, but that
would be better then picking the ones declared arbitrarily in the last core.
> QueryParsing.parseFunction uses Singleton Core (SolrCore.getSolrCore())
> -----------------------------------------------------------------------
>
> Key: SOLR-1067
> URL: https://issues.apache.org/jira/browse/SOLR-1067
> Project: Solr
> Issue Type: Bug
> Affects Versions: 1.3
> Reporter: Hoss Man
> Fix For: 1.4
>
>
> QueryParsing.parseFunction is a static utility method that depends on the
> SolrCore.getSolrCore singleton -- but it is not yet deprecated and is used in
> some rather important places in the code base (the result is that the last
> core initialized
> it was noted a while back, with some comments about how to tackle the
> problem, but it looks like we never opened an issue to deal with it...
> http://www.nabble.com/QueryParsing-using-SolrCore.getSolrCore()-td19806087.html
> ...we should deal with this in some way prior to the 1.4 release (if nothing
> else, we need to document it as a caveat).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.