Re: Dynamically calculated range facet

2007-06-27 Thread Chris Hostetter

: my documents (products) have a price field, and I want to have
: a dynamically calculated range facet for that in the response.

FYI: there have been some previous discussions on this topic...

http://www.nabble.com/blahblah-t2387813.html#a6799060
http://www.nabble.com/faceted-browsing-t1363854.html#a3753053

: AFAICS I do not have the possibility to specify range queries in my
: application, as I do not have a clue what's the lowest and highest
: price in the search result and what are good ranges according
: to the (statistical) distribution of prices in the search result.

as mentioned in one of those threads, it's *really* hard to get the
statistical sampling to the point where it's both balanced, but also user
freindly.  writing code specificly for price ranges in dollars lets you
make some assumptions about things that give you nice ranges (rounding
to one significant digit less then the max, doing log based ranges, etc..)
that wouldn't really apply if you were trying to implement a truely
generic dynamic range generator.

one thing to keep in mind: it's typically not a good idea to have the
constraint set of a facet change just because some other constraint was
added to the query -- individual constraints might disappear because
they no longer apply, but it can be very disconcerting to a user to
when options hcange on them  if i search on ipod a statistical
analysis of prices might yeild facet ranges of $1-20, $20-60, $60-120,
$120-$200 ... if i then click on accessories the statistics might skew
cheaper, so hte new ranges are $1-20, $20-30, $30-40, $40-70 ...  and now
i'm a frustrated user, because i relaly wanted ot use the range $20-60
(that just happens to be my budget) and you offered it to me and then you
took it away ... i have to undo my selection or accessories then click
$20-60, and then click accessories to get what i wnat ... not very nice.

: So if it would be possible to go over each item in the search result
: I could check the price field and define my ranges for the specific
: query on solr side and return the price ranges as a facet.

: Otherwise, what would be a good starting point to plug in such
: functionality into solr?

if you relaly want to do statistical distributions, one way to avoid doing
all of this work on the client side (and needing to pull back all of hte
prices from all of hte matches) would be to write a custom request handler
that subclasses whichever on you currently use and does this computation
on the server side -- where it has lower level access to the data and
doesn't need to stream it over the wire.  FieldCache in particular would
come in handy.

it occurs to me that even though there may not be a way to dynamicly
create facet ranges that can apply usefully on any numeric field, we could
add generic support to the request handlers for optionally fetching some
basic statistics about a DocSet for clients that want them (either for
building ranges, or for any other purpose)

min, max, mean, median, mode, midrange ... those should all be easy to
compute using the ValueSource from the field type (it would be nice if
FieldType's had some way of indicating which DocValues function can best
manage the field type, but we can always assume float or have an option
for dictating it ... people might want a float mean for an int field
anyway)

i suppose even stddev could be computed fairly easily ... there's a
formula for that that works well in a single pass over a bunch of values
right?




-Hoss



Re: Dynamically calculated range facet

2007-06-27 Thread Martin Grotzke
Chris, thanx for all this info! I'll think about these things again
and then come back to you...

Cheers,
Martin


On Tue, 2007-06-26 at 23:22 -0700, Chris Hostetter wrote:
 : my documents (products) have a price field, and I want to have
 : a dynamically calculated range facet for that in the response.
 
 FYI: there have been some previous discussions on this topic...
 
 http://www.nabble.com/blahblah-t2387813.html#a6799060
 http://www.nabble.com/faceted-browsing-t1363854.html#a3753053
 
 : AFAICS I do not have the possibility to specify range queries in my
 : application, as I do not have a clue what's the lowest and highest
 : price in the search result and what are good ranges according
 : to the (statistical) distribution of prices in the search result.
 
 as mentioned in one of those threads, it's *really* hard to get the
 statistical sampling to the point where it's both balanced, but also user
 freindly.  writing code specificly for price ranges in dollars lets you
 make some assumptions about things that give you nice ranges (rounding
 to one significant digit less then the max, doing log based ranges, etc..)
 that wouldn't really apply if you were trying to implement a truely
 generic dynamic range generator.
 
 one thing to keep in mind: it's typically not a good idea to have the
 constraint set of a facet change just because some other constraint was
 added to the query -- individual constraints might disappear because
 they no longer apply, but it can be very disconcerting to a user to
 when options hcange on them  if i search on ipod a statistical
 analysis of prices might yeild facet ranges of $1-20, $20-60, $60-120,
 $120-$200 ... if i then click on accessories the statistics might skew
 cheaper, so hte new ranges are $1-20, $20-30, $30-40, $40-70 ...  and now
 i'm a frustrated user, because i relaly wanted ot use the range $20-60
 (that just happens to be my budget) and you offered it to me and then you
 took it away ... i have to undo my selection or accessories then click
 $20-60, and then click accessories to get what i wnat ... not very nice.
 
 : So if it would be possible to go over each item in the search result
 : I could check the price field and define my ranges for the specific
 : query on solr side and return the price ranges as a facet.
 
 : Otherwise, what would be a good starting point to plug in such
 : functionality into solr?
 
 if you relaly want to do statistical distributions, one way to avoid doing
 all of this work on the client side (and needing to pull back all of hte
 prices from all of hte matches) would be to write a custom request handler
 that subclasses whichever on you currently use and does this computation
 on the server side -- where it has lower level access to the data and
 doesn't need to stream it over the wire.  FieldCache in particular would
 come in handy.
 
 it occurs to me that even though there may not be a way to dynamicly
 create facet ranges that can apply usefully on any numeric field, we could
 add generic support to the request handlers for optionally fetching some
 basic statistics about a DocSet for clients that want them (either for
 building ranges, or for any other purpose)
 
 min, max, mean, median, mode, midrange ... those should all be easy to
 compute using the ValueSource from the field type (it would be nice if
 FieldType's had some way of indicating which DocValues function can best
 manage the field type, but we can always assume float or have an option
 for dictating it ... people might want a float mean for an int field
 anyway)
 
 i suppose even stddev could be computed fairly easily ... there's a
 formula for that that works well in a single pass over a bunch of values
 right?
 
 
 
 
 -Hoss
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: Dynamically calculated range facet

2007-06-27 Thread Martin Grotzke
On Tue, 2007-06-26 at 16:48 -0700, Mike Klaas wrote:
 On 26-Jun-07, at 3:01 PM, Martin Grotzke wrote:
  AFAICS I do not have the possibility to specify range queries in my
  application, as I do not have a clue what's the lowest and highest
  price in the search result and what are good ranges according
  to the (statistical) distribution of prices in the search result.
 
  So if it would be possible to go over each item in the search result
  I could check the price field and define my ranges for the specific
  query on solr side and return the price ranges as a facet.
 
  Has anybody done s.th. like this before, or is there s.th. that I'm
  missing and why this approach does not make sense at all?
 
  Otherwise, what would be a good starting point to plug in such
  functionality into solr?
 
 Easy: facet based on fixed ranges (say, every 10 dollars for x  100,  
 100 dollars for x  1000, etc)., and combine them sensically on the  
 client-side.  Requires no solr-side modification.
But then I have to find x (the highest value of the price field?) on
solr side and also I have to build the fixed ranges on solr side, right?

Cheers,
Martin

 
 A bit harder: define your own request handler that loops over the  
 documents after a search and samples the values of (say) the first 20  
 docs (or more, but be sure to use the FieldCache if so).  Calculate  
 your range queries, facets (code will be almost identical to the code  
 in the builtin request handlers), and return the results.
 
 cheers,
 -Mike
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: Dynamically calculated range facet

2007-06-27 Thread Martin Grotzke
On Tue, 2007-06-26 at 19:53 -0700, John Wang wrote:
 www.browseengine.com has facet search that handles this.
You are calculating range facets dynamically? Do you have any
code I can have a look at? I had a look at c.b.solr.
BoboRequestHandler, but this does not seem to calculate ranges.

Cheers,
Martin

 
 We are working on a solr plugin.
 
 -John
 
 On 6/26/07, Mike Klaas [EMAIL PROTECTED] wrote:
 
  On 26-Jun-07, at 3:01 PM, Martin Grotzke wrote:
   AFAICS I do not have the possibility to specify range queries in my
   application, as I do not have a clue what's the lowest and highest
   price in the search result and what are good ranges according
   to the (statistical) distribution of prices in the search result.
  
   So if it would be possible to go over each item in the search result
   I could check the price field and define my ranges for the specific
   query on solr side and return the price ranges as a facet.
  
   Has anybody done s.th. like this before, or is there s.th. that I'm
   missing and why this approach does not make sense at all?
  
   Otherwise, what would be a good starting point to plug in such
   functionality into solr?
 
  Easy: facet based on fixed ranges (say, every 10 dollars for x  100,
  100 dollars for x  1000, etc)., and combine them sensically on the
  client-side.  Requires no solr-side modification.
 
  A bit harder: define your own request handler that loops over the
  documents after a search and samples the values of (say) the first 20
  docs (or more, but be sure to use the FieldCache if so).  Calculate
  your range queries, facets (code will be almost identical to the code
  in the builtin request handlers), and return the results.
 
  cheers,
  -Mike
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Error Response as HTML in Solr 1.2

2007-06-27 Thread Maximilian Hütter
Hi all,

I switched to Solr version 1.2 and found that the response format
changed completely for the error responses (for updates), which are
delivered as HTML-Pages.

Before it was just XML coming back in all cases. Is there a way to
change this to XML? Some switch in the solrconfig.xml I didn't see?

Could I use a different RequestHandler? Should I use the new URL for
updates, I still use the leagacy form.

Best regards,

Max


-- 
Maximilian Hütter
blue elephant systems GmbH
Wollgrasweg 49
D-70599 Stuttgart

Tel:  (+49) 0711 - 45 10 17 578
Fax:  (+49) 0711 - 45 10 17 573
e-mail :  [EMAIL PROTECTED]
Sitz   :  Stuttgart, Amtsgericht Stuttgart, HRB 24106
Geschäftsführer:  Joachim Hörnle, Thomas Gentsch, Holger Dietrich


Re: XML vs JSON writer performance issues

2007-06-27 Thread Jérôme Etévé


2007/6/27, Yonik Seeley [EMAIL PROTECTED]:

 It would be helpful if you could try out the patch at
 https://issues.apache.org/jira/browse/SOLR-276

 -Yonik


I just tryed it out and it works. json output is now as fast as xml !
Well done :) thank you !

J.

--
Jerome Eteve.
[EMAIL PROTECTED]
http://jerome.eteve.free.fr/


Re: snapshooter no go

2007-06-27 Thread Bill Au

I would also check

ls -ld /foo/jetty-6.1.3

too.

Bill

On 6/27/07, Chris Hostetter [EMAIL PROTECTED] wrote:



: Here is a puzzling one.  I can't get Solr to invoke snaphooter properly.
: Solr claims my snapshooter is not where I said it is:
:
: SEVERE: java.io.IOException: Cannot run program snapshooter (in
: directory solr/bin): java.io.IOException: error=2, No such file or
: directory

off the top of my head, i suspect the problem may be that there is not
PATH env var so it can't find snapshooter but it might be able to find
./snapshooter

either that or...

: $ cd /foo/jetty-6.1.3
: $ ls -al solr/bin/snapshooter
: -rwxr-xr-x 1 otis otis 2624 Jun 20 02:53 solr/bin/snapshooter

...what does ls -ald solr solr/bin tell you?  are the directories world
executable (assuming jetty isn't running as otis)




-Hoss




Re: snapshooter no go

2007-06-27 Thread Otis Gospodnetic
PATH - bingo!
The config + the log message are a bit misleading there, IMHO.

The dir is documented as:
  dir - dir to use as the current working directory. default=.

And its default value is defined as:
  str name=dirsolr/bin/str

The error was:
   Cannot run program snapshooter (in directory /foo/jetty-6.1.3/solr/bin): 
java.io.IOException: error=2, No such file or directory

All of this makes you (me) think that Solr uses the dir + exe name to call 
snapshooter with the full path, a la /foo/jetty-6.1.3/solr/bin/snapshooter, 
which must not be the case.

Moreover, it looks like even though I set Solr home to be outside Jetty 
directory, one has to put the dir that is the Solr home dir under Jetty, or at 
least link jetty/solr/bin to solr home/bin, OR change that dir to be 
../solr/bin (but this didn't work without adding /full/path/to/solr/bin to 
PATH).

Otis



- Original Message 
From: Chris Hostetter [EMAIL PROTECTED]
To: solr-user@lucene.apache.org
Sent: Wednesday, June 27, 2007 7:20:28 AM
Subject: Re: snapshooter no go


: Here is a puzzling one.  I can't get Solr to invoke snaphooter properly.
: Solr claims my snapshooter is not where I said it is:
:
: SEVERE: java.io.IOException: Cannot run program snapshooter (in
: directory solr/bin): java.io.IOException: error=2, No such file or
: directory

off the top of my head, i suspect the problem may be that there is not
PATH env var so it can't find snapshooter but it might be able to find
./snapshooter

either that or...

: $ cd /foo/jetty-6.1.3
: $ ls -al solr/bin/snapshooter
: -rwxr-xr-x 1 otis otis 2624 Jun 20 02:53 solr/bin/snapshooter

...what does ls -ald solr solr/bin tell you?  are the directories world
executable (assuming jetty isn't running as otis)




-Hoss






RE: Dynamically calculated range facet

2007-06-27 Thread Will Johnson
one thing to keep in mind: it's typically not a good idea to have the
constraint set of a facet change just because some other constraint was
added to the query -- individual constraints might disappear because
they no longer apply, but it can be very disconcerting to a user to
when options hcange on them  if i search on ipod a statistical
analysis of prices might yeild facet ranges of $1-20, $20-60, $60-120,
$120-$200 ... if i then click on accessories the statistics might
skew
cheaper, so hte new ranges are $1-20, $20-30, $30-40, $40-70 ...  and
now
i'm a frustrated user, because i relaly wanted ot use the range $20-60
(that just happens to be my budget) and you offered it to me and then
you
took it away ... i have to undo my selection or accessories then
click
$20-60, and then click accessories to get what i wnat ... not very
nice.

Many of the other engines I've work with in the past did this and it was
one of the most requested/implemented features we had with regard to
facets.  That doesn't make it 'right' but it did tend to make product
managers and test users happy.  The use case that often came up was the
ability to dynamically drill inside ranges.  For instance my first
search for 'computer on a large ecommerce site might yield ranges of
0-500, 500-1000, 1000-2000, 2000+, selecting 500-1000 might then yield
ranges of 500-600, 600-700 and so on. There are also many different
algorithms that can be employed: equal frequency per facet count, equal
sized ranges, rounded ranges, etc.

- will 



Re: multiple indices

2007-06-27 Thread Rafael Rossini

I have 3 different instances of solr on jetty 6.1.13, but you need the jetty
plus.
my etc/jetty.xml looks like this

   Call name=addLifeCycle
 Arg
New class=org.mortbay.jetty.webapp.WebAppContext
   ArgRef id=Contexts//Arg
   ArgSystemProperty name=jetty.home default=./*
/webapps/solr1*/Arg
   Arg*/solr1*/Arg
  Set name=ConfigurationClassesRef id=plusConfig//Set
  Set name=defaultsDescriptorSystemProperty name=
jetty.home default=.//etc/webdefault.xml/Set
  New id=solr_home class=
org.mortbay.jetty.plus.naming.EnvEntry
 Argsolr/home/Arg
 Arg type=java.lang.StringSystemProperty name=
jetty.home default=./override this value/Arg
  /New
 /New
 /Arg
   /Call
   Call name=addLifeCycle
 Arg
New class=org.mortbay.jetty.webapp.WebAppContext
   ArgRef id=Contexts//Arg
   ArgSystemProperty name=jetty.home default=./*
/webapps/solr2*/Arg
   Arg*/solr2*/Arg
  Set name=ConfigurationClassesRef id=plusConfig//Set
  Set name=defaultsDescriptorSystemProperty name=
jetty.home default=.//etc/webdefault.xml/Set
  New id=solr_home class=
org.mortbay.jetty.plus.naming.EnvEntry
 Argsolr/home/Arg
 Arg type=java.lang.StringSystemProperty name=
jetty.home default=./override this value/Arg
  /New
 /New
 /Arg
   /Call


then, on the webapps/solr1/WEB-INF you need a jetty-env.xml like this:

?xml version=1.0?
!DOCTYPE Configure PUBLIC -//Mort Bay Consulting//DTD Configure//EN 
http://jetty.mortbay.org/configure.dtd;

Configure class=org.mortbay.jetty.webapp.WebAppContext

!-- Add an override for a global EnvEntry   --
New id=solr_home class=org.mortbay.jetty.plus.naming.EnvEntry
 Argsolr/home/Arg
 Arg type=java.lang.StringSystemProperty name=jetty.home
default=.//solr1/Arg
/New

/Configure



Hope it helps



On 6/26/07, Otis Gospodnetic [EMAIL PROTECTED] wrote:


Hm, that JNDI again... this makes it sound like SOLR-215 is completely
superfluous?
I have not configured Jetty this way yet, but I do see some docs on
http://wiki.apache.org/solr/SolrJetty .  Interestingly, the configs look a
lot different than what's described on
http://docs.codehaus.org/display/JETTY/JNDI .  I also remember Jetty Plus
from a while back, but now I cannot find any information about Jetty Plus
6.*, only 5 - http://jetty.mortbay.org/jetty5/plus/index.html .

Otis



- Original Message 
From: Chris Hostetter [EMAIL PROTECTED]
To: solr-user@lucene.apache.org
Sent: Tuesday, June 26, 2007 8:10:46 PM
Subject: Re: multiple indices


:   I have multiple applications (blogs/forums/video/etc) - each of these
: is independent (no need to perform queries on multiple indices).

:   Would it be best to use multiple instances of SOLR/JVM - one for each
: index or use a solution where only one JVM instance is running (maybe
: solr-215?)?


you don't actaully need multiple JVM instances to run multiple Solr
instance ... you can configure your ServletContainer to run the solr.war
in multiple contexts each of which has a differnet solrconfig.xml and
schema.xml (using JNDI) ... that way you get most of hte benefits of
isolated instances but also can also take advantage of a single large heap
and common connection management.




-Hoss







RE: Dynamically calculated range facet

2007-06-27 Thread Martin Grotzke
On Wed, 2007-06-27 at 09:06 -0400, Will Johnson wrote:
 one thing to keep in mind: it's typically not a good idea to have the
 constraint set of a facet change just because some other constraint was
 added to the query -- individual constraints might disappear because
 they no longer apply, but it can be very disconcerting to a user to
 when options hcange on them  if i search on ipod a statistical
 analysis of prices might yeild facet ranges of $1-20, $20-60, $60-120,
 $120-$200 ... if i then click on accessories the statistics might
 skew
 cheaper, so hte new ranges are $1-20, $20-30, $30-40, $40-70 ...  and
 now
 i'm a frustrated user, because i relaly wanted ot use the range $20-60
 (that just happens to be my budget) and you offered it to me and then
 you
 took it away ... i have to undo my selection or accessories then
 click
 $20-60, and then click accessories to get what i wnat ... not very
 nice.
 
 Many of the other engines I've work with in the past did this and it was
 one of the most requested/implemented features we had with regard to
 facets.  That doesn't make it 'right' but it did tend to make product
 managers and test users happy.  The use case that often came up was the
 ability to dynamically drill inside ranges.  For instance my first
 search for 'computer on a large ecommerce site might yield ranges of
 0-500, 500-1000, 1000-2000, 2000+, selecting 500-1000 might then yield
 ranges of 500-600, 600-700 and so on. There are also many different
 algorithms that can be employed: equal frequency per facet count, equal
 sized ranges, rounded ranges, etc.
I just had a conversation with our customer and they also want to
have it like this - adjusting with a new facet constraint...

Cheers,
Martin


 
 - will 
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: Dynamically calculated range facet

2007-06-27 Thread Ryan McKinley

Martin Grotzke wrote:

On Tue, 2007-06-26 at 23:22 -0700, Chris Hostetter wrote:

: So if it would be possible to go over each item in the search result
: I could check the price field and define my ranges for the specific
: query on solr side and return the price ranges as a facet.

: Otherwise, what would be a good starting point to plug in such
: functionality into solr?

if you relaly want to do statistical distributions, one way to avoid doing
all of this work on the client side (and needing to pull back all of hte
prices from all of hte matches) would be to write a custom request handler
that subclasses whichever on you currently use and does this computation
on the server side -- where it has lower level access to the data and
doesn't need to stream it over the wire.  FieldCache in particular would
come in handy.

Now we want to have fun with statistics and calculation, and I just set
up a new project with a dependency on apache-solr-1.2.0. I started a
RangeRequestHandler extending StandardRequestHandler, but I don't really
see where to plug in. Most probably it's the handleRequestBody, but
there's a lot of stuff in StandardRequestHandler.handleRequestBody that
I do not want to repeat...



For now, if you want to integrate existing standard/dismax 
functionality, there is no great way to cleanly do this without copying 
the code.  There is discussion of 'search components' that will let you 
customize single parts of the search pipeline -- in your case faceting 
-- but this is still a ways off.


You could almost do what you need by overriding getFacetInfo(), but you 
also need to check the DocList.




To ask a question: how could I get each document of the result to
check the price and do some calculation at the end?


With a DocList, you can cycle through the matched documents using:

IndexReader reader = core.getSearcher().get().getReader();
System.out.println(response.size() =  + docs.size());
DocIterator iter = docs.iterator();
while (iter.hasNext()) {
  Document doc = reader.document(iter.next());
  System.out.println(doc =  + doc);
}

ryan


Re: Dynamically calculated range facet

2007-06-27 Thread Mike Klaas

On 27-Jun-07, at 1:07 AM, Martin Grotzke wrote:


On Tue, 2007-06-26 at 16:48 -0700, Mike Klaas wrote:

On 26-Jun-07, at 3:01 PM, Martin Grotzke wrote:



Easy: facet based on fixed ranges (say, every 10 dollars for x  100,
100 dollars for x  1000, etc)., and combine them sensically on the
client-side.  Requires no solr-side modification.



But then I have to find x (the highest value of the price field?) on
solr side and also I have to build the fixed ranges on solr side,  
right?


Not if you always ask for facets up to the maximum price in the  
index, and use facet.mincount=1


cheers,
-MIke



Re: multiple indices

2007-06-27 Thread Chris Hostetter

: Hm, that JNDI again... this makes it sound like SOLR-215 is completely
: superfluous?

No ... i still haven't had a chance to review the patch, but Henri makes
some great argmuments for the WHY of the patch in the issue
description...

 Multiple cores:
 Deployment issues within some organizations where IT will resist
 deploying multiple web applications.
 Seamless schema update where you can create a new core and switch to
 it without starting/stopping servers.
 Embedding Solr in your own application (instead of 'raw' Lucene) and
 functionally need to segregate schemas  collections.

(there are some other arguments i'm not sure i buy into, but these seem
very justified)


-Hoss



RE: Dynamically calculated range facet

2007-06-27 Thread Chris Hostetter

: managers and test users happy.  The use case that often came up was the
: ability to dynamically drill inside ranges.  For instance my first
: search for 'computer on a large ecommerce site might yield ranges of
: 0-500, 500-1000, 1000-2000, 2000+, selecting 500-1000 might then yield
: ranges of 500-600, 600-700 and so on. There are also many different

that's a very differnet behavior from what i described ... what you are
talking about is really sub faceting or hierarchical faceting ... the
user chooses a constraint in a facet, and now new sub-constraints are
available for that facet.  (a more general example of this use case is:
once a constraint is picked for one facet, new facets are offered. ie:
only offer a city facet once a constriant has been selected for a
state facet.  sub-ranges in the same facet are just a special case of
this)

the behavior i was warning against is changing the constraints offered in
facetA (price) becuase a constraint has been sleected in facetB (category
or something else) ... a good faceting UI should allways take away optiosn
htat no longer apply (so if by picking accessories the set of results
has shrunk so that there are no matches in the $100-200 range, then take
that option away) but changing the list of posisble constraints the user
can choose from when they make a selection in a completley unrelated facet
is a really bad UI design .. one of the keys of a good facet UI is that it
lets the user browse they way they want to browse, adding constraints and
removing constraints as it makes sense to them, you don't want to alienate
them by changing the set of options you give them for a field just because
the statistical breakdown changes slightly.

imagine you are a film director using an actor search engine to help you
cast a part in your movie... you come to the site, and start clicking on
constraits to help you narrow the options.  when you first come to the
site you have age ranges listed: 1-10, 10-20, 20-30, 30-40, 40-50, 50-60,
60-80 ... you click on juggling in the special skills facet and
because there are onlytwo actors who can juggle available in the
application now your age ranges dynamicly change to 1-40 and 40-80 because
one of hte actors is 20 and the other is 60 and these rnages give yo uan
even statistical division of hte availbale pool ... but it doesn't add
anything to the user experience, it makes it harder for the director
quickly see that they can't hire a 30-50 year old juggler because the
statistical range selection took away information when it resized the
ranges.





-Hoss



Re: Dynamically calculated range facet

2007-06-27 Thread Chris Hostetter

: For now, if you want to integrate existing standard/dismax
: functionality, there is no great way to cleanly do this without copying

: You could almost do what you need by overriding getFacetInfo(), but you
: also need to check the DocList.


actually, for this use case i think overriding getFacetInfo is a perfectly
clean way to go about it (one of hte view parts of those request hadlers
that is easy to override) ... i'm not sure why you'd want the DocLIst for
this ... iterating over it will only get the matches on the current page
-- and if that's all you want stats for you might aswell do it on the
client side.  You can iterate over al lthe docs in the DocSet as well ...
but i would recommend using the FieldCache to get the indexed values
instead of using the stored values - and the ValueSource of your fieldtype
can make this really easy.

your handler would look something like...

public class MyHandler extends StandardRequestHandler {
  public void init(NamedList l) {
 /* parse any config options you want */
 super.init(l);
  }
  protected NamedList getFacetInfo(SolrQueryRequest req,
   SolrQueryResponse rsp,
   DocSet mainSet) {
 NamedList res = super.getFacetInto(req,rsp,mainSet);
 SchemaField field = /* get the field you want stats on from the 
IndexSchema */
 DocValues vals = 
field.getType().getValueSource(field).getValues(req.getSearcher().getReader());
 DocIter i = mainSet.iterator()
 while (i.hasNext()) {
int val = vals.floatVal(i.next());
/* do whatever you want with the value */
 }
 /* add your stats to res */
 return res;
   }
}


...that's it.


-Hoss



RE: snapshooter no go

2007-06-27 Thread Xuesong Luo
I got similar problems, tried both default setting solr/bin and full
path /export/home/jboss/jboss-4.0.5.GA/bin/solr/bin, neither works. I'm
using 1.2.


2007-06-27 14:10:03,907 ERROR [STDERR] Jun 27, 2007 2:10:03 PM
org.apache.solr.update.DirectUpdateHandler2 commit
INFO: start commit(optimize=true,waitFlush=true,waitSearcher=true)
2007-06-27 14:10:03,961 ERROR [STDERR] Jun 27, 2007 2:10:03 PM
org.apache.solr.core.SolrException log
SEVERE: java.io.IOException: snapshooter: not found
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.init(UNIXProcess.java:53)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
at java.lang.Runtime.exec(Runtime.java:591)
at
org.apache.solr.core.RunExecutableListener.exec(RunExecutableListener
.java:70)
at
org.apache.solr.core.RunExecutableListener.postCommit(RunExecutableLi
stener.java:97)
at
org.apache.solr.update.UpdateHandler.callPostCommitCallbacks(UpdateHa
ndler.java:99)




RE: snapshooter no go

2007-06-27 Thread Xuesong Luo
I thought I had to use the full path in dir attribute, later I realized
I should modify the environment variable path. Now it's working, I
didn't append ./ before snapshooter.

Thanks
Xuesong

-Original Message-
From: Chris Hostetter [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 27, 2007 2:49 PM
To: solr-user@lucene.apache.org
Subject: RE: snapshooter no go


: I got similar problems, tried both default setting solr/bin and full
: path /export/home/jboss/jboss-4.0.5.GA/bin/solr/bin, neither works.
I'm
: using 1.2.

Did you try setting exe to ./snapshooter ?

for the record, there is no default setting of solr/bin in either
the
code, or in the example solrconfig ... there is only a commented out
example (which is clearly a bad example based on the confusion it seems
to
be causing and the fact that if you uncomment it, it doesn't work
properly)


-Hoss




Re: i wanna change response type to PHP serialize

2007-06-27 Thread James liu

It is slower than json and xml,,,and it will change my content into ???

when i use json , content is ok.

afternoon, iwill read ur code.


2007/6/27, James liu [EMAIL PROTECTED]:


ok,,thks nick,,,i just forget replace jar file..

wait a minute i will test speed...



2007/6/27, Nick Jenkin [EMAIL PROTECTED]:

 http://nickjenkin.com/misc/apache-solr-1.2.0-php-serialize.tar.gz

 Try that
 -Nick

 On 6/27/07, James liu [EMAIL PROTECTED] wrote:
  i use tomcat ,, send ur solr version to me...i try it again..
 
  2007/6/27, Nick Jenkin [EMAIL PROTECTED]:
  
   If you are using the example provided in 1.2 (using jetty) you need
 to
   use ant example
   rather than ant dist
  
   -Nick
  
   On 6/27/07, James liu [EMAIL PROTECTED] wrote:
Yes, i use 1.2my compile method:
download solr 1.2 and modify file by your patch.
   
use `ant dist` to compile it. no error show.
   
i can see its admin gui, but i wanna try search, it will show me
 the
   error
information,
   
Is my compile method right? if not, show me how to compile it.
   
it seems very strange ,only me fail? anyone have same question?
   
if free, maybe u zip your solr to me by mail...and i try it again.
   
   
2007/6/26, Nick Jenkin [EMAIL PROTECTED] :

 Interesting, what version of solr are you using, I tested on 1.2
 .
 -Nick

 On 6/26/07, James liu  [EMAIL PROTECTED] wrote:
  i just cp it to src\java\org\apache\solr\request and ant
 dist...i
   think
  maybe my method is wrong.
 
  same error infromation...
 
  java.lang.NoClassDefFoundError:
 org/apache/solr/search/ScorePriorityQueue
  at
 org.apache.solr.search.SolrIndexSearcher.getDocListNC(
 SolrIndexSearcher.java:886)
  at
 org.apache.solr.search.SolrIndexSearcher.getDocListC (
 SolrIndexSearcher.java:805)
  at org.apache.solr.search.SolrIndexSearcher.getDocList
 (
 SolrIndexSearcher.java:698)
  at
 org.apache.solr.request.StandardRequestHandler.handleRequestBody
 (
 StandardRequestHandler.java:122)
  at
 org.apache.solr.handler.RequestHandlerBase.handleRequest (
 RequestHandlerBase.java:77)
  at org.apache.solr.core.SolrCore.execute(SolrCore.java
 :658)
  at org.apache.solr.servlet.SolrServlet.doGet (
   SolrServlet.java
 :66)
  at javax.servlet.http.HttpServlet.service(
 HttpServlet.java
   :690)
  at javax.servlet.http.HttpServlet.service (
 HttpServlet.java
   :803)
  at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
 (
 ApplicationFilterChain.java:290)
  at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(
 ApplicationFilterChain.java:206)
  at org.apache.solr.servlet.SolrDispatchFilter.doFilter(
 SolrDispatchFilter.java:185)
  at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
 (
 ApplicationFilterChain.java :235)
  at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(
 ApplicationFilterChain.java:206)
  at
 org.apache.catalina.core.StandardWrapperValve.invoke (
 StandardWrapperValve.java:228)
  at
 org.apache.catalina.core.StandardContextValve.invoke(
 StandardContextValve.java:175)
  at org.apache.catalina.core.StandardHostValve.invoke(
 StandardHostValve.java:128)
  at org.apache.catalina.valves.ErrorReportValve.invoke(
 ErrorReportValve.java :104)
  at org.apache.catalina.core.StandardEngineValve.invoke
 (
 StandardEngineValve.java:109)
  at org.apache.catalina.connector.CoyoteAdapter.service(
 CoyoteAdapter.java:216)
  at org.apache.coyote.http11.Http11Processor.process(
 Http11Processor.java:844)
  at

  
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
 Http11Protocol.java:634)
  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run (
 JIoEndpoint.java:445)
  at java.lang.Thread.run(Unknown Source)
 
 
 
 
  2007/6/26, Nick Jenkin [EMAIL PROTECTED]:
  
   I have some good news :o)
  
   https://issues.apache.org/jira/browse/SOLR-275
  
   Please let me know if you find any bugs
   Thanks
   -Nick
  
   On 6/26/07, James liu [EMAIL PROTECTED]  wrote:
I think it simple to u.
   
so i wait for ur good news.
   
2007/6/26, Nick Jenkin [EMAIL PROTECTED]:

 I am also quite interested in getting a serialized PHP
 array
 response
 writer, after some investigation it doesn't seem as
 difficult
   as I
 first thought, I will have a try at implementing this
 when I
   get
 some
 time, the format of the array would probably end up
 being the
   same
 as
 if you were to use json_decode.
 -Nick
  

Re: i wanna change response type to PHP serialize

2007-06-27 Thread Nick Jenkin

Hi James
It is totally not optimized, when you say change your content into
???, I assume this is because of UTF8 issues, are you using
utf8_decode etc?
Thanks
-Nick
On 6/28/07, James liu [EMAIL PROTECTED] wrote:

It is slower than json and xml,,,and it will change my content into ???

when i use json , content is ok.

afternoon, iwill read ur code.


2007/6/27, James liu [EMAIL PROTECTED]:

 ok,,thks nick,,,i just forget replace jar file..

 wait a minute i will test speed...



 2007/6/27, Nick Jenkin [EMAIL PROTECTED]:
 
  http://nickjenkin.com/misc/apache-solr-1.2.0-php-serialize.tar.gz
 
  Try that
  -Nick
 
  On 6/27/07, James liu [EMAIL PROTECTED] wrote:
   i use tomcat ,, send ur solr version to me...i try it again..
  
   2007/6/27, Nick Jenkin [EMAIL PROTECTED]:
   
If you are using the example provided in 1.2 (using jetty) you need
  to
use ant example
rather than ant dist
   
-Nick
   
On 6/27/07, James liu [EMAIL PROTECTED] wrote:
 Yes, i use 1.2my compile method:
 download solr 1.2 and modify file by your patch.

 use `ant dist` to compile it. no error show.

 i can see its admin gui, but i wanna try search, it will show me
  the
error
 information,

 Is my compile method right? if not, show me how to compile it.

 it seems very strange ,only me fail? anyone have same question?

 if free, maybe u zip your solr to me by mail...and i try it again.


 2007/6/26, Nick Jenkin [EMAIL PROTECTED] :
 
  Interesting, what version of solr are you using, I tested on 1.2
  .
  -Nick
 
  On 6/26/07, James liu  [EMAIL PROTECTED] wrote:
   i just cp it to src\java\org\apache\solr\request and ant
  dist...i
think
   maybe my method is wrong.
  
   same error infromation...
  
   java.lang.NoClassDefFoundError:
  org/apache/solr/search/ScorePriorityQueue
   at
  org.apache.solr.search.SolrIndexSearcher.getDocListNC(
  SolrIndexSearcher.java:886)
   at
  org.apache.solr.search.SolrIndexSearcher.getDocListC (
  SolrIndexSearcher.java:805)
   at org.apache.solr.search.SolrIndexSearcher.getDocList
  (
  SolrIndexSearcher.java:698)
   at
  org.apache.solr.request.StandardRequestHandler.handleRequestBody
  (
  StandardRequestHandler.java:122)
   at
  org.apache.solr.handler.RequestHandlerBase.handleRequest (
  RequestHandlerBase.java:77)
   at org.apache.solr.core.SolrCore.execute(SolrCore.java
  :658)
   at org.apache.solr.servlet.SolrServlet.doGet (
SolrServlet.java
  :66)
   at javax.servlet.http.HttpServlet.service(
  HttpServlet.java
:690)
   at javax.servlet.http.HttpServlet.service (
  HttpServlet.java
:803)
   at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
  (
  ApplicationFilterChain.java:290)
   at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(
  ApplicationFilterChain.java:206)
   at org.apache.solr.servlet.SolrDispatchFilter.doFilter(
  SolrDispatchFilter.java:185)
   at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
  (
  ApplicationFilterChain.java :235)
   at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(
  ApplicationFilterChain.java:206)
   at
  org.apache.catalina.core.StandardWrapperValve.invoke (
  StandardWrapperValve.java:228)
   at
  org.apache.catalina.core.StandardContextValve.invoke(
  StandardContextValve.java:175)
   at org.apache.catalina.core.StandardHostValve.invoke(
  StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(
  ErrorReportValve.java :104)
   at org.apache.catalina.core.StandardEngineValve.invoke
  (
  StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(
  CoyoteAdapter.java:216)
   at org.apache.coyote.http11.Http11Processor.process(
  Http11Processor.java:844)
   at
 
   
  org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
  Http11Protocol.java:634)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run (
  JIoEndpoint.java:445)
   at java.lang.Thread.run(Unknown Source)
  
  
  
  
   2007/6/26, Nick Jenkin [EMAIL PROTECTED]:
   
I have some good news :o)
   
https://issues.apache.org/jira/browse/SOLR-275
   
Please let me know if you find any bugs
Thanks
-Nick
   
On 6/26/07, James liu [EMAIL PROTECTED]  wrote:
 I think it simple to u.

 so i wait for ur good news.

 2007/6/26, Nick Jenkin [EMAIL PROTECTED]:
 
  I am also quite interested in 

Re: i wanna change response type to PHP serialize

2007-06-27 Thread James liu

code not change,,,and i not use utf8_decodeshould do it?

2007/6/28, Nick Jenkin [EMAIL PROTECTED]:


Hi James
It is totally not optimized, when you say change your content into
???, I assume this is because of UTF8 issues, are you using
utf8_decode etc?
Thanks
-Nick
On 6/28/07, James liu [EMAIL PROTECTED] wrote:
 It is slower than json and xml,,,and it will change my content into ???

 when i use json , content is ok.

 afternoon, iwill read ur code.


 2007/6/27, James liu [EMAIL PROTECTED]:
 
  ok,,thks nick,,,i just forget replace jar file..
 
  wait a minute i will test speed...
 
 
 
  2007/6/27, Nick Jenkin [EMAIL PROTECTED]:
  
   http://nickjenkin.com/misc/apache-solr-1.2.0-php-serialize.tar.gz
  
   Try that
   -Nick
  
   On 6/27/07, James liu [EMAIL PROTECTED] wrote:
i use tomcat ,, send ur solr version to me...i try it again..
   
2007/6/27, Nick Jenkin [EMAIL PROTECTED]:

 If you are using the example provided in 1.2 (using jetty) you
need
   to
 use ant example
 rather than ant dist

 -Nick

 On 6/27/07, James liu [EMAIL PROTECTED] wrote:
  Yes, i use 1.2my compile method:
  download solr 1.2 and modify file by your patch.
 
  use `ant dist` to compile it. no error show.
 
  i can see its admin gui, but i wanna try search, it will show
me
   the
 error
  information,
 
  Is my compile method right? if not, show me how to compile it.
 
  it seems very strange ,only me fail? anyone have same
question?
 
  if free, maybe u zip your solr to me by mail...and i try it
again.
 
 
  2007/6/26, Nick Jenkin [EMAIL PROTECTED] :
  
   Interesting, what version of solr are you using, I tested on
1.2
   .
   -Nick
  
   On 6/26/07, James liu  [EMAIL PROTECTED] wrote:
i just cp it to src\java\org\apache\solr\request and ant
   dist...i
 think
maybe my method is wrong.
   
same error infromation...
   
java.lang.NoClassDefFoundError:
   org/apache/solr/search/ScorePriorityQueue
at
   org.apache.solr.search.SolrIndexSearcher.getDocListNC(
   SolrIndexSearcher.java:886)
at
   org.apache.solr.search.SolrIndexSearcher.getDocListC (
   SolrIndexSearcher.java:805)
at
org.apache.solr.search.SolrIndexSearcher.getDocList
   (
   SolrIndexSearcher.java:698)
at
  
org.apache.solr.request.StandardRequestHandler.handleRequestBody
   (
   StandardRequestHandler.java:122)
at
   org.apache.solr.handler.RequestHandlerBase.handleRequest (
   RequestHandlerBase.java:77)
at org.apache.solr.core.SolrCore.execute(
SolrCore.java
   :658)
at org.apache.solr.servlet.SolrServlet.doGet (
 SolrServlet.java
   :66)
at javax.servlet.http.HttpServlet.service(
   HttpServlet.java
 :690)
at javax.servlet.http.HttpServlet.service (
   HttpServlet.java
 :803)
at
  
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
   (
   ApplicationFilterChain.java:290)
at
   org.apache.catalina.core.ApplicationFilterChain.doFilter(
   ApplicationFilterChain.java:206)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(
   SolrDispatchFilter.java:185)
at
  
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
   (
   ApplicationFilterChain.java :235)
at
   org.apache.catalina.core.ApplicationFilterChain.doFilter(
   ApplicationFilterChain.java:206)
at
   org.apache.catalina.core.StandardWrapperValve.invoke (
   StandardWrapperValve.java:228)
at
   org.apache.catalina.core.StandardContextValve.invoke(
   StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(
   StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(
   ErrorReportValve.java :104)
at
org.apache.catalina.core.StandardEngineValve.invoke
   (
   StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(
   CoyoteAdapter.java:216)
at
org.apache.coyote.http11.Http11Processor.process(
   Http11Processor.java:844)
at
  

  
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
   Http11Protocol.java:634)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run (
   JIoEndpoint.java:445)
at java.lang.Thread.run(Unknown Source)
   
   
   
   
2007/6/26, Nick Jenkin [EMAIL PROTECTED]:

 I have some good news :o)

 https://issues.apache.org/jira/browse/SOLR-275

 Please let me know if you find any bugs
 Thanks
 -Nick

filter field have to be indexed?

2007-06-27 Thread James liu

i means define it in schema.xml,,,



--
regards
jl