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 Matt Mitchell <go...@gmail.com> on 2009/11/24 23:03:29 UTC
why is XMLWriter declared as final?
Is there any reason the XMLWriter is declared as final? I'd like to extend
it for a special case but can't. The other writers (ruby, php, json) are not
final.
Thanks,
Matt
Re: why is XMLWriter declared as final?
Posted by Matt Mitchell <go...@gmail.com>.
OK thanks Shalin.
Matt
On Wed, Nov 25, 2009 at 8:48 AM, Shalin Shekhar Mangar <
shalinmangar@gmail.com> wrote:
> On Wed, Nov 25, 2009 at 3:33 AM, Matt Mitchell <go...@gmail.com>
> wrote:
>
> > Is there any reason the XMLWriter is declared as final? I'd like to
> extend
> > it for a special case but can't. The other writers (ruby, php, json) are
> > not
> > final.
> >
> >
> I don't think it needs to be final. Maybe it is final because it wasn't
> designed to be extensible. Please open a jira issue.
>
> --
> Regards,
> Shalin Shekhar Mangar.
>
Re: why is XMLWriter declared as final?
Posted by Chris Hostetter <ho...@fucit.org>.
: response. I want my MLT docs to have only 2 fields, but I need my main docs
: fl to have all fields.
...
: -- It'd be great to let components have control over their fl value instead
: of having a global fl value for all doc lists within a writer?
Mmmm.... yeah, this is a big failing of all the components at this point
-- as i recall there is code in the SolrQueryResponse object that lets you
associate a field list with each DocList added to the response, and then
the ResponseWriters can look at it to decide which fields to write out for
each doc, but i don't think a single utilizes it.
please feel free to open a bug against the MLT component -- you shouldn't
need a custom response writer to deal with this.
-Hoss
Re: why is XMLWriter declared as final?
Posted by Matt Mitchell <go...@gmail.com>.
Interesting. Well just to clarify my intentions a bit, I'll quickly explain
what I was trying to do.
I'm using the MLT component but because some of my stored fields are really
big, I don't need (or want) all of the fields for my MLT docs in the
response. I want my MLT docs to have only 2 fields, but I need my main docs
fl to have all fields.
So a simple override of the XMLWriter writeNamedList method would do the
trick. All you have to do is check if the name == "moreLikeThis". If so,
process the docs and specify a different field list. If not, just call
super(). Worked like a charm, but oh well. I really only need the Ruby
response anyway, so I'll move on to that. I'm glad this spurred some
interest though.
-- It'd be great to let components have control over their fl value instead
of having a global fl value for all doc lists within a writer?
Matt
On Wed, Nov 25, 2009 at 2:33 PM, Chris Hostetter
<ho...@fucit.org>wrote:
>
> : I don't think it needs to be final. Maybe it is final because it wasn't
> : designed to be extensible. Please open a jira issue.
>
> it really wasn't, and it probably shouldn't be ... there is another thread
> currently in progress (in response to SOLR-1592) about this.
>
> Given how kludgy the entire API is, i'd really prefer it not be made
> un-final .. it would need some serious overhaul/review to make it possible
> to subclass in a sensical way, and coming up with a new API is likely to
> make a lot more sense then trying to retrofit that one.
>
> -Hoss
>
>
Re: why is XMLWriter declared as final?
Posted by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov>.
Hi Hoss,
What I meant by the sentence is actually it's a good thing to work on it now because SOLR is in "dev" stage, and not in "pre-release" or "feature freeze" state, as indicated by the *-dev on the release #...
Cheers,
Chris
On 11/29/09 3:55 PM, "Chris Hostetter" <ho...@fucit.org> wrote:
I don't really understand what you mean by this sentence ... but i get the
impression that you are saying we shouldn't attempt anythign too major
just because the version info on the trunk says "1.5-dev"
that doesn't mean anyone is expecting to release 1.5 ASAP ... that's just
the default version info on the trunk ("-dev" appended to whatever we
expect the next version to be ... if at some point we decide the next
version should be called 49.3 then the trunk would change to "49.3-dev"
besides which: since what we're talking about is really a brand new API
that other ResponseWriters could compose and/or extend to produce XML
structures, even if we did anticipate a release ASAP there would be no
downside to working on it now -- we just wouldn't release it (or release
it as package private) if we didn't think it was ready.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: Chris.Mattmann@jpl.nasa.gov
WWW: http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Re: why is XMLWriter declared as final?
Posted by Chris Hostetter <ho...@fucit.org>.
: I think it's good to do that incrementally, though, rather than all at
: once, especially considering SOLR is in 1.5-dev trunk stage atm.
I don't really understand what you mean by this sentence ... but i get the
impression that you are saying we shouldn't attempt anythign too major
just because the version info on the trunk says "1.5-dev"
that doesn't mean anyone is expecting to release 1.5 ASAP ... that's just
the default version info on the trunk ("-dev" appended to whatever we
expect the next version to be ... if at some point we decide the next
version should be called 49.3 then the trunk would change to "49.3-dev"
besides which: since what we're talking about is really a brand new API
that other ResponseWriters could compose and/or extend to produce XML
structures, even if we did anticipate a release ASAP there would be no
downside to working on it now -- we just wouldn't release it (or release
it as package private) if we didn't think it was ready.
-Hoss
Re: why is XMLWriter declared as final?
Posted by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov>.
Hey Hoss,
+1. I think we need to overhaul the whole API, even in light of the incremental progress I've been proposing and patching, etc., lately.
I think it's good to do that incrementally, though, rather than all at once, especially considering SOLR is in 1.5-dev trunk stage atm.
Cheers,
Chris
On 11/25/09 11:33 AM, "Chris Hostetter" <ho...@fucit.org> wrote:
: I don't think it needs to be final. Maybe it is final because it wasn't
: designed to be extensible. Please open a jira issue.
it really wasn't, and it probably shouldn't be ... there is another thread
currently in progress (in response to SOLR-1592) about this.
Given how kludgy the entire API is, i'd really prefer it not be made
un-final .. it would need some serious overhaul/review to make it possible
to subclass in a sensical way, and coming up with a new API is likely to
make a lot more sense then trying to retrofit that one.
-Hoss
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: Chris.Mattmann@jpl.nasa.gov
WWW: http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Re: why is XMLWriter declared as final?
Posted by Chris Hostetter <ho...@fucit.org>.
: I don't think it needs to be final. Maybe it is final because it wasn't
: designed to be extensible. Please open a jira issue.
it really wasn't, and it probably shouldn't be ... there is another thread
currently in progress (in response to SOLR-1592) about this.
Given how kludgy the entire API is, i'd really prefer it not be made
un-final .. it would need some serious overhaul/review to make it possible
to subclass in a sensical way, and coming up with a new API is likely to
make a lot more sense then trying to retrofit that one.
-Hoss
Re: why is XMLWriter declared as final?
Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Wed, Nov 25, 2009 at 3:33 AM, Matt Mitchell <go...@gmail.com> wrote:
> Is there any reason the XMLWriter is declared as final? I'd like to extend
> it for a special case but can't. The other writers (ruby, php, json) are
> not
> final.
>
>
I don't think it needs to be final. Maybe it is final because it wasn't
designed to be extensible. Please open a jira issue.
--
Regards,
Shalin Shekhar Mangar.