sorting problem

2007-05-08 Thread Gal Nitzan
Hi,

I have 2 fields which I would like to sort by, one is a "date" field and the 
other is "sint".

My query tries to search all entries which their ctype is video sorted by 
tstamp descending and then sorted by popularity:

q=ctype:video;tstamp desc;popularity desc&fl=tstamp,popularity

However the results returned are sorted only by the tstamp.


0
2007-05-08T12:58:45,023Z


0
2007-05-08T12:58:39,062Z


4923
2007-05-08T12:58:37,710Z


0
2007-05-08T12:58:37,651Z


Any idea what I'm missing?

TIA,

Gal





Re: UTF-8 problem with Resin

2007-05-08 Thread Koji Sekiguchi

The problem was gone. Thank you very much for the handling.

Koji

Ryan McKinley wrote:

sorry.  I tested with something that did not duplicate the problem.

update and try rev 536048.


Koji Sekiguchi wrote:

Ryan,

Thank you for committing SOLR-214, but we are still facing the 
garbled characters problem

under Tomcat 5.5.23.

I checked the patch, but unfortunately, ContentStreamBase.getReader() 
works correctly
when using stream.* parameters. Without stream.* parameters, 
contentType is null and

ContentStreamBase.getReader() uses system default encoding.

Could you check it please?

Best regards,

Koji










Re: sorting problem

2007-05-08 Thread Chris Hostetter

: My query tries to search all entries which their ctype is video sorted by
: tstamp descending and then sorted by popularity:

: However the results returned are sorted only by the tstamp.


Solr stores datefields with millisecond precision, so if you index a date
field without rounding, then all of htat precision is going to be there
when it comes time to sort ... you can clearly see in your output that the
results are strictly sorted by your first critera .. the secondary sort
will only come into play if two docs have *exactly* the same value for the
tstamp field.

assuming you generate your tstamp field using the "NOW" default in your
schema.xml, you can get rounding by using the DateMath feature, something
like this...

   

...but if you are generating the tstamp field values in your client and
then sending them to Solr, you'll need to do the rounding there.

-Hoss



cwd requirement to run Solr with Tomcat

2007-05-08 Thread Teruhiko Kurosaka
I struggled to run Solr in Tomcat 5.5 (or 6.0 for that matter).
Then I found a step-by-step instruction at
http://wiki.apache.org/solr/SolrTomcat
and followed it as much as possible (wget URL didn't work, so
I had to download using browser).  Then Solr worked.

An important factor in the instruction is that Tomcat must 
be started from the directory under which the solr directory
(copied from the exmaple) exists. That is, Solr runs only
if Tomcat is invoked as:
$ ./apache-tomcat-5.5.20/bin/startup.sh
It doesn't if Tomcat is invoked like this:
$ cd ./apache-tomcat-5.5.20/bin
$ startup.sh

Where is this restriction come from? This restriction
seems problematic because solr can't be run with
another webapp with a similar restriction in the
same app server. Has anybody explored to get rid of 
this restriction?

Another thing I don't understand is why Tomcat shows
NoClassDefFoundError when the solr directory cannot
be found in the current working directory. There is no
class files or jar files under the solr directory, so I don't
understand why putting the solr directory can remove 
this NoClassDefFoundError. (I wasted good hours trying
to figure out what classes are missing and why.)

-kuro


Re: cwd requirement to run Solr with Tomcat

2007-05-08 Thread Chris Hostetter
: An important factor in the instruction is that Tomcat must
: be started from the directory under which the solr directory
: (copied from the exmaple) exists. That is, Solr runs only
: if Tomcat is invoked as:
: $ ./apache-tomcat-5.5.20/bin/startup.sh
: It doesn't if Tomcat is invoked like this:
: $ cd ./apache-tomcat-5.5.20/bin
: $ startup.sh

that's not true.  if you use JNDI or system properties to configure the
"solr home", then the working directory for Tomcat can be anything you
want.  Solr only relies on the working directory as a fall back in the
absense of any other information about hwre it can find it's
configuration.

this is discussed at some length in the wikis on seting up solr for
Tomcat, cna you suggest any ways to make hte documentation more clear? ...

http://wiki.apache.org/solr/SolrInstall
http://wiki.apache.org/solr/SolrTomcat

: Another thing I don't understand is why Tomcat shows
: NoClassDefFoundError when the solr directory cannot
: be found in the current working directory. There is no

I suspect your were mislead by a situation in which multiple exceptions
were being logged.  The SolrCore class will attempt to find it's
configuration, if it can not, it will throw an exception to that affect
which will be logged ... since it can't find it's configs the SolrCore
class will fail to load, which may then (aparently) cause Tomcat
to also log a NoClassDefFoundError.  (I haven't tested this myself,
recently, i'm taking your word for it that's the error Tomcat produces)

The key to remember is that you have to "debug in order" start with teh
first error/warning/exception that is logged and look at it -- it may
frequently be the cause of other subsequent errors/warnings/exceptions.



-Hoss



RE: cwd requirement to run Solr with Tomcat

2007-05-08 Thread Teruhiko Kurosaka
Thank you, Hoss, for replying m question.

> : An important factor in the instruction is that Tomcat must
> : be started from the directory under which the solr directory
> : (copied from the exmaple) exists

> that's not true.  if you use JNDI or system properties to 
> configure the
> "solr home", then the working directory for Tomcat can be anything you
> want. 
...

That's another thing I ma having problem with.

Tomcat seems to have changed the way to configure things, starting
with 5.5. If I follow the instruction given in the "Configuraing Solr
Home
with JNDI" section in
>   http://wiki.apache.org/solr/SolrTomcat

Tomat ignores it with this warning message in the log:
WARNING: A docBase /home/kuro/solr-tomcat/tomcat-5.5.23/webapps/solr.war
inside the host appBase has been specified, and will be ignored


>  cna you suggest any ways to make hte documentation more clear? .

I'd simply add another sentence at the end of Simpe Example Install: 
  ... by default. If you would like to run startup.sh from somewhere
else, specify the solr home as described in the next section.

-kuro


RE: cwd requirement to run Solr with Tomcat

2007-05-08 Thread Chris Hostetter

: Tomcat seems to have changed the way to configure things, starting
: with 5.5. If I follow the instruction given in the "Configuraing Solr
: Home
: with JNDI" section in
: > http://wiki.apache.org/solr/SolrTomcat
:
: Tomat ignores it with this warning message in the log:
: WARNING: A docBase /home/kuro/solr-tomcat/tomcat-5.5.23/webapps/solr.war
: inside the host appBase has been specified, and will be ignored

did you try searching for that error message? the first result google gave
me points to this mailing list thread...

http://mail-archives.apache.org/mod_mbox/tomcat-dev/200512.mbox/[EMAIL 
PROTECTED]

...which indicates thatthis is what Tomcat says when you are refrencing
the same path in two places ... probably because you have an appBase
configured to server everything in the webapps directory and you've got
hte explicit Context fragment.  The thread suggests that you should put
the war somplace else (or get rid of the appBase).

: >  cna you suggest any ways to make hte documentation more clear? .
:
: I'd simply add another sentence at the end of Simpe Example Install:
:   ... by default. If you would like to run startup.sh from somewhere
: else, specify the solr home as described in the next section.

well it's a wiki, so in the future if you think there are improvements to
be made please feel free to make them, but i went ahead and added
something similar to what you suggested.  thanks for the feedback.


-Hoss



RE: cwd requirement to run Solr with Tomcat

2007-05-08 Thread Teruhiko Kurosaka

> did you try searching for that error message? the first 
> result google gave
> me points to this mailing list thread...
> 
> http://mail-archives.apache.org/mod_mbox/tomcat-dev/200512.mbo
> x/[EMAIL PROTECTED]
> 

Yes, I found this email archive thread in another mail archive site.
I tried nuking appBase but that didn't solve the obscure exception, 
and I sent my question thinking maybe this is something unique to
Solr.   I guess not.

-kuro


RE: sorting problem

2007-05-08 Thread Gal Nitzan

Thank you, Hoss...

> -Original Message-
> From: Chris Hostetter [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 08, 2007 8:41 PM
> To: solr-user@lucene.apache.org; [EMAIL PROTECTED]
> Subject: Re: sorting problem
>
>
> : My query tries to search all entries which their ctype is video sorted
> by
> : tstamp descending and then sorted by popularity:
>
> : However the results returned are sorted only by the tstamp.
>
>
> Solr stores datefields with millisecond precision, so if you index a date
> field without rounding, then all of htat precision is going to be there
> when it comes time to sort ... you can clearly see in your output that the
> results are strictly sorted by your first critera .. the secondary sort
> will only come into play if two docs have *exactly* the same value for the
> tstamp field.
>
> assuming you generate your tstamp field using the "NOW" default in your
> schema.xml, you can get rounding by using the DateMath feature, something
> like this...
>
>
>
> ...but if you are generating the tstamp field values in your client and
> then sending them to Solr, you'll need to do the rounding there.
>
> -Hoss




Re: something i think about "facet"

2007-05-08 Thread James liu

aha,,win fix it。

Do u remember when i first use analyzer to support Chinese?

They have same question, so fix it is just to encode it 'UTF-8'.

In win, use "save as " and choose encode type to 'utf-8'

restart tomcat,,,and u will find it is ok.

my solrconfig.xml like this

   

>   forumname
>   forumname:娱乐
> 
>





2007/5/8, James liu <[EMAIL PROTECTED]>:


aha,,i Just wanna show the count.

thks, Hoss

2007/5/8, Chris Hostetter <[EMAIL PROTECTED]>:
>
>
> : if use 100 facets,,,it will cost more than use 10 facet.
>
> you can't show the top 10 unless you calculate the count for all of
> them.
>
> if you are using facet.field, Solr is already computing the count for
> *every* field value .. regardless of what facet.limit is set to  asking
> for 10 doesn't cost any less then asking for 100.
>
>
>
> -Hoss
>
>


--
regards
jl





--
regards
jl


Re: question about FederatedSearch on wiki

2007-05-08 Thread Koji Sekiguchi

Chris,

Thank you for your answer. With your answer, I'll reread yonik's article 
and try to understand his idea.


Why I'm interested in it because I have a customer and they will use 
Solr to serve a good many

documents. We expect we need to implement federated search function
in a year as the contents grow on a day to day.

One of my co-worker has been implementing a federated search on try and 
error basis.
I'll review the program in next week and if it is fine, we'll post it on 
JIRA in order to

get feedbacks from community as my customer is hoping.

Thank you again,

Koji


Chris Hostetter wrote:

:
: I'm interested in FederatedSearch on wiki:
:
: http://wiki.apache.org/solr/FederatedSearch
:
: I would like to understand the design concept of this article properly,
: and I have some questions:

i think so far that page has just been yonik's scratch pad for ideas, so
you may not get any detailed answers to your questions until he gets back
from vaction

: 1. What does "multi-step" mean?
: e.g.
: Nice to haves:
: Retain ability to have complex *multi-step* query handler plugins

i believe that is refering to the ability for a request handler to take
two operations using the underlying API, and know that the results of
those operations will make sense relative eachother: ie, do a search, get
results back, then get facet count info and get numbers that make sense
given the results of hte search.

: 2. It seems that "consistency" is one of key concept in Complex Federation,
: but I don't really understand it. In other words, I don't understand
: what inconvenience we will face if the request handler doesn't guarantee
: that the view of the index does not change during a single request.

consider the example above, you could wind up telling a user that there
are 345,678 results for their search, and 876,543 of those results are in
the "books" category (if lots of docs get added to the index in the middle
of hte request)

: 3. Will SolrMultiSearcher have caches? (filter, queryResult, and document)

that's like asking if the 2011 Dodge Viper will be a Hybrid-Electic or
bio-diesel ... it's just a concept at the moment, with no concrete design
or prototype, who knows what it will be.



-Hoss


  




Re: cwd requirement to run Solr with Tomcat

2007-05-08 Thread James liu

i use freebsd(csh),,and use cmd like


/tmp/*tomcat*/bin/startup.sh



if u use


./apache-tomcat-5.5.20/bin/startup.sh



u maybe


chmod +x ./*tomcat*/bin/startup.sh



or


sh ./*tomcat*/bin/startup.sh




i have 15 instances in one box(use tomcat)





2007/5/9, Teruhiko Kurosaka <[EMAIL PROTECTED]>:



> did you try searching for that error message? the first
> result google gave
> me points to this mailing list thread...
>
> http://mail-archives.apache.org/mod_mbox/tomcat-dev/200512.mbo
> x/[EMAIL PROTECTED]
>

Yes, I found this email archive thread in another mail archive site.
I tried nuking appBase but that didn't solve the obscure exception,
and I sent my question thinking maybe this is something unique to
Solr.   I guess not.

-kuro





--
regards
jl


Returning all rows from a query

2007-05-08 Thread Thiago Jackiw
Is there a way to retrieve all rows found without having to specify a value for 
it (?q=sales&rows=HUGE_NUMBER)? For instance, what I'd like to do would be 
something like "rows=*" or "rows=all" and that would return all the records 
found, without any limits.

Thanks.


Re: Returning all rows from a query

2007-05-08 Thread Chris Hostetter

: Is there a way to retrieve all rows found without having to specify a
: value for it (?q=sales&rows=HUGE_NUMBER)? For instance, what I'd like to
: do would be something like "rows=*" or "rows=all" and that would return
: all the records found, without any limits.

there's really no good reason to do something like this .. it would be
completley impractical in most cases, you would only want to use it if you
know you are dealing with result sets that are so small they can feasibly
be transmited in a managable amount .. but if that's the case just specify
what you consider a "managable amount" as your HUGE_NUMBER and get the
best of both worlds (all the results when your assumption is right, and a
sanity cap on the result size if it turns out your assumptions are wrong.

that said, i have no problem letting people whot themselves in the foot if
thye want, so if you'd like to submit a patch that makes a negative
value for the "row" param mean "return all" i wouldn't object.

(using a negative value is how facet.limit works so it's more consistent
then "*" or "all")



-Hoss