get the fields of solr

2007-12-19 Thread Edward Zhang
I need to get all the fields of a remote solr istance. I try to parse the
xmlstream returned by "admin/get-file.jsp?file=schema.xml&core=core1".Is
there any other way?

BTW: The xmlstream contain 3 space lines in head and 2 in tail, which
cause some trouble to parse.

Every reply appreciated.


Re: get the fields of solr

2007-12-20 Thread Edward Zhang
Thanks, Ryan!

 I tried it, but the "QTime" was beyond my tolerance.It costs me about 53s
on average to "show=schema".The index contains *5456360 *documents. The
index was optimized.Is there any more fast way? Information responsed as
follows: *
*   
- 

- 

  0
  50187
  
  This response format is experimental. It is likely to
change in the future.
- 

  5456360
  5456360
  25930032
  1196480831539
  true
  true
  false
  
org.apache.lucene.store.FSDirectory:[EMAIL 
PROTECTED]:\LabHome\solrxhome\data\index

  2007-12-02T11:26:54.625Z
  



On 12/20/07, Ryan McKinley <[EMAIL PROTECTED]> wrote:
>
> Check the LukeRequestHandler:
> http://wiki.apache.org/solr/LukeRequestHandler
>
>
> Edward Zhang wrote:
> > I need to get all the fields of a remote solr istance. I try to parse
> the
> > xmlstream returned by "admin/get-file.jsp?file=schema.xml&core=core1".Is
> > there any other way?
> >
> > BTW: The xmlstream contain 3 space lines in head and 2 in tail, which
> > cause some trouble to parse.
> >
> > Every reply appreciated.
> >
>
>


Re: get the fields of solr

2007-12-20 Thread Edward Zhang
Wow, thanks for Yonik 's quick reply! :)

That is what I want!

I just tried numTerms=500 then I ignored the useness of numTerms.




On 12/21/07, Yonik Seeley <[EMAIL PROTECTED]> wrote:
>
> On Dec 20, 2007 8:47 PM, Edward Zhang <[EMAIL PROTECTED]> wrote:
> >  I tried it, but the "QTime" was beyond my tolerance.It costs me about
> 53s
> > on average to "show=schema".
>
> That's probably because Luke tries to find the top terms for each
> field by default.
> Try passing in numTerms=0
>
> -Yonik
>
>
> The index contains *5456360 *documents. The
> > index was optimized.Is there any more fast way? Information responsed as
> > follows: *
> > *   
> > - 
> >
> > - 
> >
> >   0
> >   50187
> >   
> >   This response format is experimental. It is likely
> to
> > change in the future.
> > - 
> >
> >   5456360
> >   5456360
> >   25930032
> >   1196480831539
> >   true
> >   true
> >   false
> >   
> >
> org.apache.lucene.store.FSDirectory:[EMAIL PROTECTED]
> :\LabHome\solrxhome\data\index
> >
> >   2007-12-02T11:26:54.625Z
> >   
> >
> >
> >
> >
> > On 12/20/07, Ryan McKinley <[EMAIL PROTECTED]> wrote:
> > >
> > > Check the LukeRequestHandler:
> > > http://wiki.apache.org/solr/LukeRequestHandler
> > >
> > >
> > > Edward Zhang wrote:
> > > > I need to get all the fields of a remote solr istance. I try to
> parse
> > > the
> > > > xmlstream returned by "admin/get-file.jsp?file=schema.xml&core=core1
> ".Is
> > > > there any other way?
> > > >
> > > > BTW: The xmlstream contain 3 space lines in head and 2 in tail,
> which
> > > > cause some trouble to parse.
> > > >
> > > > Every reply appreciated.
> > > >
> > >
> > >
> >
>


Re: MultCore changes

2007-12-23 Thread Edward Zhang
Also, it may need a handler responses how many cores there are and what they
are.

On 12/22/07, Ryan McKinley <[EMAIL PROTECTED]> wrote:
>
> For folks using the new MultiCore stuff in 1.3-dev...
>
> The interface just changed so that all requests require a core name and
> the '@' is no longer supported.  That is:
>
> -  http://localhost:8983/solr/@core0/select?q=*:*
> +  http://localhost:8983/solr/core0/select?q=*:*
>
> Also, this should fix the problems people were seeing with ?core=null in
> the admin pages
>
>
> ryan
>


Re: MultCore changes

2007-12-23 Thread Edward Zhang
I am sorry, I get the entry. In order to get all cores,try
*admin/multicore?action=STATUS*


On 12/24/07, Edward Zhang <[EMAIL PROTECTED]> wrote:
>
> Also, it may need a handler responses how many cores there are and what
> they are.
>
> On 12/22/07, Ryan McKinley <[EMAIL PROTECTED]> wrote:
> >
> > For folks using the new MultiCore stuff in 1.3-dev...
> >
> > The interface just changed so that all requests require a core name and
> > the '@' is no longer supported.  That is:
> >
> > -  http://localhost:8983/solr/@core0/select?q=*:*
> > +   http://localhost:8983/solr/core0/select?q=*:*
> >
> > Also, this should fix the problems people were seeing with ?core=null in
> > the admin pages
> >
> >
> > ryan
> >
>
>


Re: solr 1.3

2008-01-20 Thread Edward Zhang
http://svn.apache.org/repos/asf/lucene/solr/trunk
or
http://lucene.apache.org/solr/version_control.html


On 1/21/08, anuvenk <[EMAIL PROTECTED]> wrote:
>
>
> Could you please let me know the location from where i can get it.
>
> climbingrose wrote:
> >
> > I'm using code pulled directly from Subversion.
> >
> > On Jan 21, 2008 12:34 PM, anuvenk <[EMAIL PROTECTED]> wrote:
> >
> >>
> >> Thanks. Would this be the latest code from the trunk that you
> mentioned?
> >> http://people.apache.org/builds/lucene/solr/nightly/solr-2008-01-19.zip
> >>
> >>
> >> climbingrose wrote:
> >> >
> >> > I don't think they (Solr developers) have a time frame for 1.3release.
> >> > However, I've been using the latest code from the trunk and I can
> tell
> >> you
> >> > it's quite stable. The only problem is the documentation sometimes
> >> doesn't
> >> > cover lastest changes in the code. You'll probably have to dig into
> the
> >> > code
> >> > itself or post a question here and many people will be happy to help
> >> you.
> >> >
> >> > On Jan 21, 2008 12:07 PM, anuvenk <[EMAIL PROTECTED]> wrote:
> >> >
> >> >>
> >> >> when will this be released? where can i find the list of
> >> >> improvements/enhancements in 1.3 if its been documented already?
> >> >> --
> >> >> View this message in context:
> >> >> http://www.nabble.com/solr-1.3-tp14989395p14989395.html
> >> >> Sent from the Solr - User mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >
> >> >
> >> > --
> >> > Regards,
> >> >
> >> > Cuong Hoang
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/solr-1.3-tp14989395p14989689.html
> >> Sent from the Solr - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Regards,
> >
> > Cuong Hoang
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/solr-1.3-tp14989395p14989802.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>


Some problem with ShowFileRequestHandler

2008-03-05 Thread Edward Zhang
I want to programmatically retrieve the schema and the config from the
ShowFileRequestHandler.  I encounter some trouble. There are CJK characters
in the xml files as follows:


>  
>  记录号
>

But I get a confusing response from solr using "/admin/file/?file=schema.xml".
IE and firefox both report parse errors.I try "/admin/file/?file=
schema.x&contentType=text/plain" and I get the same result as follow:


>  
>  ?/uniqueKey>


BTW: The xml files are encoded in UTF-8 and they work fine when I open these
files locally using IE. And I set tomcat's 8080 connector "URIEncoding"
argument "UTF-8" too.
So is there anything missing for me? Or is it a bug?

Every reply would be appreciated.


Re: Some problem with ShowFileRequestHandler

2008-03-06 Thread Edward Zhang
My workmate and me found a solution to this problem: it caused by
org.apache.solr.request.RawResponseWriter.
Solr required the config file encoded in UTF-8 by far. But when
RawResponseWriter put the byte stream to writer, it doesn't notice the
characters encoding.There may be some trouble when the xml file contain
CJK characters.

 So we add argument "utf-8" for method "IOUtils.copy" and we send the
request with "admin/file/?file=schema.xml&contentType=text/xml;charset=utf-8",
it works!

Am I right?

May be method "IOUtils.copy( content.getStream(), writer)" keep default
encoding argument for more encoded config files support?


>   public void write(Writer writer, SolrQueryRequest request,
> SolrQueryResponse response) throws IOException
>   {
> Object obj = response.getValues().get( CONTENT );
> if( obj != null && (obj instanceof ContentStream ) ) {
>   // copy the contents to the writer...
>   ContentStream content = (ContentStream)obj;
>   //IOUtils.copy( content.getStream(), writer);
>   IOUtils.copy( content.getStream(), writer, "utf-8");
> }
> else {
>   getBaseWriter( request ).write( writer, request, response );
> }
>   }
>
On 3/6/08, Edward Zhang <[EMAIL PROTECTED]> wrote:
>
> I want to programmatically retrieve the schema and the config from the
> ShowFileRequestHandler.  I encounter some trouble. There are CJK characters
> in the xml files as follows:
>
>
> >  
> >  记录号
> >
>
> But I get a confusing response from solr using "/admin/file/?file=
> schema.xml". IE and firefox both report parse errors.I try
> "/admin/file/?file=schema.x&contentType=text/plain" and I get the same
> result as follow:
>
>
> >  
> >  ?/uniqueKey>
>
>
> BTW: The xml files are encoded in UTF-8 and they work fine when I open
> these files locally using IE. And I set tomcat's 8080 connector
> "URIEncoding" argument "UTF-8" too.
> So is there anything missing for me? Or is it a bug?
>
> Every reply would be appreciated.
>
>
>
>
>


Re: Some problem with ShowFileRequestHandler

2008-03-06 Thread Edward Zhang
It wroks, and a request with
argument "&contentType=text/xml;charset=utf-8"  required to show my CJK
characters in my config file.

Thanks, Ryan

On 3/7/08, Ryan McKinley <[EMAIL PROTECTED]> wrote:
>
> Thanks for pointing this out.
>
> In trunk, I changed the RawResponseWriter to use the Reader rather then
> the Stream -- this way, you should not have to specify the contentType
> to make it match the FileReader.
>
> Does this fix your issues?
>
> thanks
> ryan
>
>
> Edward Zhang wrote:
> > My workmate and me found a solution to this problem: it caused by
> > org.apache.solr.request.RawResponseWriter.
> > Solr required the config file encoded in UTF-8 by far. But when
> > RawResponseWriter put the byte stream to writer, it doesn't notice the
> > characters encoding.There may be some trouble when the xml file contain
> > CJK characters.
> >
> >  So we add argument "utf-8" for method "IOUtils.copy" and we send the
> > request with "admin/file/?file=schema.xml&contentType=text/xml
> ;charset=utf-8",
> > it works!
> >
> > Am I right?
> >
> > May be method "IOUtils.copy( content.getStream(), writer)" keep default
> > encoding argument for more encoded config files support?
> >
> >
> >>   public void write(Writer writer, SolrQueryRequest request,
> >> SolrQueryResponse response) throws IOException
> >>   {
> >> Object obj = response.getValues().get( CONTENT );
> >> if( obj != null && (obj instanceof ContentStream ) ) {
> >>   // copy the contents to the writer...
> >>   ContentStream content = (ContentStream)obj;
> >>   //IOUtils.copy( content.getStream(), writer);
> >>   IOUtils.copy( content.getStream(), writer, "utf-8");
> >> }
> >> else {
> >>   getBaseWriter( request ).write( writer, request, response );
> >> }
> >>   }
> >>
> > On 3/6/08, Edward Zhang <[EMAIL PROTECTED]> wrote:
> >> I want to programmatically retrieve the schema and the config from the
> >> ShowFileRequestHandler.  I encounter some trouble. There are CJK
> characters
> >> in the xml files as follows:
> >>
> >>
> >>>  
> >>>  记录号
> >>>
> >> But I get a confusing response from solr using "/admin/file/?file=
> >> schema.xml". IE and firefox both report parse errors.I try
> >> "/admin/file/?file=schema.x&contentType=text/plain" and I get the same
> >> result as follow:
> >>
> >>
> >>>  
> >>>  ?/uniqueKey>
> >>
> >> BTW: The xml files are encoded in UTF-8 and they work fine when I open
> >> these files locally using IE. And I set tomcat's 8080 connector
> >> "URIEncoding" argument "UTF-8" too.
> >> So is there anything missing for me? Or is it a bug?
> >>
> >> Every reply would be appreciated.
> >>
> >>
> >>
> >>
> >>
>
>


Re: Some problem with ShowFileRequestHandler

2008-03-06 Thread Edward Zhang
Oh,I am sorry, Ryan, I am afriad I made a mistake.
It doesn't work yet.When I deploy the new war, it looks like before.
I rewrite to "IOUtils.copy( content.getStream(), writer, "utf-8" )" and it
works fine again!