Use of caches.

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Use of caches.

maustin
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
Reply | Threaded
Open this post in threaded view
|

Re: Use of caches.

Chris Hostetter-3

: 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

Reply | Threaded
Open this post in threaded view
|

solrconfig environment variable

maustin
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

Reply | Threaded
Open this post in threaded view
|

Re: solrconfig environment variable

Yonik Seeley
On 5/23/06, maustin75 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: solrconfig environment variable

Chris Hostetter-3
In reply to this post by maustin

: 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

Reply | Threaded
Open this post in threaded view
|

Re: solrconfig environment variable

maustin
Ahh.. ok..
"java -D solr.solr.home=/myhome/solr -jar start.jar" - That will work.

Thanks Chris and Yonik.

----- Original Message -----
From: "Chris Hostetter" <[hidden email]>
To: <[hidden email]>
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
>

Reply | Threaded
Open this post in threaded view
|

Re: solrconfig environment variable

Yonik Seeley
On 5/23/06, maustin75 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: solrconfig environment variable

maustin
hehe.. I did think that was a typo.
Sorry to underestimate your typing abilities :)

----- Original Message -----
From: "Yonik Seeley" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, May 23, 2006 5:24 PM
Subject: Re: solrconfig environment variable


On 5/23/06, maustin75 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: solrconfig environment variable

Chris Hostetter-3

: hehe.. I did think that was a typo.
: Sorry to underestimate your typing abilities :)

I think you have Yonik confused with me :)


-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: solrconfig environment variable

Marcus Stratmann
In reply to this post by maustin
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
Reply | Threaded
Open this post in threaded view
|

Re: solrconfig environment variable

Chris Hostetter-3

: 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

Reply | Threaded
Open this post in threaded view
|

Re: solrconfig environment variable

Bill Au
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 <[hidden email]> 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
>
>