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 Mike Austin <ma...@gmail.com> on 2006/05/15 06:16:07 UTC

Use of caches.

I was just reading threads about the use of caches.

OK.. I have about 100 categories that I want to bitwise AND together with
different searches to get category counts.  After the user selects a
category, they will be using other facets based on the particular category.
I was planning to keep my own structure of bitsets for the categories and
let solr handle all other caching with the default filterCache.  My question
is: Should I keep my own structure for the 100 bitsets because I always want
these to be around or should I do it another way with a solr defined user
cache?

Thanks

Re: solrconfig environment variable

Posted by Yonik Seeley <ys...@gmail.com>.
On 5/23/06, maustin75 <ma...@gmail.com> wrote:
> does the System.getProperty function read from the environment variables

Unfortunately not... Java doesn't have a way to read environment
variables AFAIK (omitted in the name of portability).
The easiest way to set a system property is on the command line when
starting the JVM.

Example:
java -Dsolr.solr.home=/myhome/solr -jar start.jar

-Yonik

Re: solrconfig environment variable

Posted by Chris Hostetter <ho...@fucit.org>.
: hehe.. I did think that was a typo.
: Sorry to underestimate your typing abilities :)

I think you have Yonik confused with me :)


-Hoss


Re: solrconfig environment variable

Posted by maustin75 <ma...@gmail.com>.
hehe.. I did think that was a typo.
Sorry to underestimate your typing abilities :)

----- Original Message ----- 
From: "Yonik Seeley" <ys...@gmail.com>
To: <so...@lucene.apache.org>
Sent: Tuesday, May 23, 2006 5:24 PM
Subject: Re: solrconfig environment variable


On 5/23/06, maustin75 <ma...@gmail.com> wrote:
> Ahh.. ok..
> "java -D solr.solr.home=/myhome/solr -jar start.jar" - That will work.

It won't if you put a space after the -D ;-)

java -Dsolr.solr.home=/myhome/solr -jar start.jar

-Yonik

Re: solrconfig environment variable

Posted by Yonik Seeley <ys...@gmail.com>.
On 5/23/06, maustin75 <ma...@gmail.com> wrote:
> Ahh.. ok..
> "java -D solr.solr.home=/myhome/solr -jar start.jar" - That will work.

It won't if you put a space after the -D ;-)

java -Dsolr.solr.home=/myhome/solr -jar start.jar

-Yonik

Re: solrconfig environment variable

Posted by maustin75 <ma...@gmail.com>.
Ahh.. ok..
"java -D solr.solr.home=/myhome/solr -jar start.jar" - That will work.

Thanks Chris and Yonik.

----- Original Message ----- 
From: "Chris Hostetter" <ho...@fucit.org>
To: <so...@lucene.apache.org>
Sent: Tuesday, May 23, 2006 5:01 PM
Subject: Re: solrconfig environment variable


>
> : does the System.getProperty function read from the environment variables
>
> System.getProperty only loads java sysntem properties, which are usually
> set using the -D command line option on the java command line
>
> There may be some Java Runtime Environments that load OS environment
> variables for you, but i don't know of any.
>
> An easy way to tell if your JRE is contains the variable you want (so that
> Solr can see it) is too start up solar, and then click the "Java
> Properties" link on the admin page...
>
> http://localhost:8983/solr/admin/get-properties.jsp
>
> ...if solr.solr.home isn't listed on that page, then Solr can't see it.
>
>
>
> -Hoss
> 


Re: solrconfig environment variable

Posted by Chris Hostetter <ho...@fucit.org>.
: does the System.getProperty function read from the environment variables

System.getProperty only loads java sysntem properties, which are usually
set using the -D command line option on the java command line

There may be some Java Runtime Environments that load OS environment
variables for you, but i don't know of any.

An easy way to tell if your JRE is contains the variable you want (so that
Solr can see it) is too start up solar, and then click the "Java
Properties" link on the admin page...

	http://localhost:8983/solr/admin/get-properties.jsp

...if solr.solr.home isn't listed on that page, then Solr can't see it.



-Hoss


Re: solrconfig environment variable

Posted by Bill Au <bi...@gmail.com>.
The admin page has a link, LOGGING, that will let you set the logging
level on the fly:

http://localhost:8983/solr/admin/logging.jsp

Bill

On 5/24/06, Chris Hostetter <ho...@fucit.org> wrote:
>
> : Talking about configuration and system properties: is it possible to set
> : the log level of Solr's logger from a system property? Or is there any
> : other way to change this level during the start of the servlet container?
>
> Solr uses JDK standard logging, (ie; the java.util.logging.* package), an
> overview of how that can be configured can be found here...
>
> http://java.sun.com/j2se/1.5.0/docs/guide/logging/overview.html
>
> ...but your servlet container may provide alternate log configuration
> options in it's configuration files.
>
>
>
> -Hoss
>
>

Re: solrconfig environment variable

Posted by Chris Hostetter <ho...@fucit.org>.
: Talking about configuration and system properties: is it possible to set
: the log level of Solr's logger from a system property? Or is there any
: other way to change this level during the start of the servlet container?

Solr uses JDK standard logging, (ie; the java.util.logging.* package), an
overview of how that can be configured can be found here...

http://java.sun.com/j2se/1.5.0/docs/guide/logging/overview.html

...but your servlet container may provide alternate log configuration
options in it's configuration files.



-Hoss


Re: solrconfig environment variable

Posted by Marcus Stratmann <st...@gmx.de>.
Talking about configuration and system properties: is it possible to set 
the log level of Solr's logger from a system property? Or is there any 
other way to change this level during the start of the servlet container?

Thanks,
Marcus

solrconfig environment variable

Posted by maustin75 <ma...@gmail.com>.
I'm having problems retrieving my system variables to set the default 
solrconfig directory.
This function returns "solr/" when the instance variable is "solr" and my 
environment/system variables include solr.solr.home = "c:\....."
This is on WinXP. I tried rebooting.

does the System.getProperty function read from the environment variables

// inside config.java
public static String getInstanceDir() {
    String str = System.getProperty(instance + ".solr.home");
   ......
}

Any ideas?
Thanks,
Mike 


Re: Use of caches.

Posted by Chris Hostetter <ho...@fucit.org>.
: OK.. I have about 100 categories that I want to bitwise AND together with
: different searches to get category counts.  After the user selects a
: category, they will be using other facets based on the particular category.
: I was planning to keep my own structure of bitsets for the categories and
: let solr handle all other caching with the default filterCache.  My question
: is: Should I keep my own structure for the 100 bitsets because I always want
: these to be around or should I do it another way with a solr defined user
: cache?

I don't even think you need a user cache -- the filterCache could probably
do everything you wnat (the one reason you might need a user cache is for
storing the list of categories and facets -- but if that's not really
going to change it can just be a static data structure)

when a users search comes in, your RequestHandler can execute it using
SolrIndexSearcher.getDocListAndSet(userQuery, null, userSort, start,
length) ... the DocList goes in the solr response, and then you can take
the DocSet and loop over all of your category queries and use
SolrIndexSearcher.numDocs(categoryQuery, yourQueryDocSet) ..
SolrIndexSearcher will make sure the DocSets for each individual
categoryQueries will be cached.

if the user has already picked a category, pass it as the second arg to
getDocListAndSet instead of null, and then instead of looping over teh
category queries, you can loop over the facet queries for your current
category.


-Hoss