Facet which takes sum of a field into account for result values

2013-05-08 Thread ld
Within MySQL it is possible to get the Top N results while summing a
particular column in the database.  For example:
SELECT ip_address, SUM(ip_count) AS count FROM table GROUP BY ip_address
ORDER BY count DESC LIMIT 5

This will return the top 5 ip_address based on the sum of ip_count.

Is there a way to have a Facet query within Solr do the same?  In other
words, count an entry as if there were 'ip_count entries', not just one?

I have used the Stats component and faceting but this gives me all the
records, there is no way to limit to the top 10 sums.  My data set may have
millions of records with much variation on IP address so this wouldn’t work.

I have also considered adding ip_count number of entries when writing to
solr but this causes some issues with the unique ID shared with legacy code
that still uses MySQL.

Any help is appreciated.  




--
View this message in context: 
http://lucene.472066.n3.nabble.com/Facet-which-takes-sum-of-a-field-into-account-for-result-values-tp4061588.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Facet which takes sum of a field into account for result values

2013-05-08 Thread ld
Unfortunately, terms do not help solve my issue.

To elaborate - say i have 5 entries:
uuid - ipaddress - ipcount
1   1.1.1.1   80
2   2.2.2.2   1
3   3.3.3.3   20
4   3.3.3.3   20

When i run a facet query on the ipaddress, i get the following results:

http://localhost:8983/solr/alerts/select?q=*:*&facet=true&facet.mincount=1&facet.limit=10&facet.field=ipaddress



2
1
1



BUT what i would like is to force the facet query to use the ipcount as the
sum, like this:



40
80
1



Using the stats component with faceting gives me what i want but due to the
fact that i cannot limit this, i worry processing the data after the query
will take a long time.

Thanks





--
View this message in context: 
http://lucene.472066.n3.nabble.com/Facet-which-takes-sum-of-a-field-into-account-for-result-values-tp4061588p4061636.html
Sent from the Solr - User mailing list archive at Nabble.com.


After Upgrade to 4.3 - EmbeddedServer errors with SSL context error

2013-06-04 Thread ld
After upgrading to 4.3 (4.1 was working fine), when creating a corecontainer
in order to create an embedded server, i get an SSL error.  

Apache is running in front of tomcat so there is no need for the SSL
connnection.  Also, i see the exception occurs with shards, i am not
currently using shards.

What has changed in 4.3 and how can i work around it to default to the old
behavior?

This is how the CoreContainer is created (following SolrWiki steps) - 

File home = new File(System.getProperty("solr.solr.home",
"./solr/conf"));
File solrXml = new File( home, "solr.xml" );

try {
CoreContainer coreContainer = new
CoreContainer(home.getAbsolutePath(), solrXml);
solrServer = new EmbeddedSolrServer(coreContainer, "");
} catch (Exception e) {
cat.error("Unable to create EmbeddedSolrServer " + 
e.getMessage(), e);
e.printStackTrace();
}   

This is stack:
2013-06-04 22:08:03,944 Unable to create EmbeddedSolrServer Failure
initializing default system SSL context
org.apache.http.conn.ssl.SSLInitializationException: Failure initializing
default system SSL context
at
org.apache.http.conn.ssl.SSLSocketFactory.createSystemSSLContext(SSLSocketFactory.java:368)
at
org.apache.http.conn.ssl.SSLSocketFactory.getSystemSocketFactory(SSLSocketFactory.java:204)
at
org.apache.http.impl.conn.SchemeRegistryFactory.createSystemDefault(SchemeRegistryFactory.java:82)
at
org.apache.http.impl.client.SystemDefaultHttpClient.createClientConnectionManager(SystemDefaultHttpClient.java:118)
at
org.apache.http.impl.client.AbstractHttpClient.getConnectionManager(AbstractHttpClient.java:466)
at
org.apache.solr.client.solrj.impl.HttpClientUtil.setMaxConnections(HttpClientUtil.java:179)
at
org.apache.solr.client.solrj.impl.HttpClientConfigurer.configure(HttpClientConfigurer.java:33)
at
org.apache.solr.client.solrj.impl.HttpClientUtil.configureClient(HttpClientUtil.java:115)
at
org.apache.solr.client.solrj.impl.HttpClientUtil.createClient(HttpClientUtil.java:105)
at
org.apache.solr.handler.component.HttpShardHandlerFactory.init(HttpShardHandlerFactory.java:152)
at
org.apache.solr.core.ConfigSolrXml.initShardHandler(ConfigSolrXml.java:350)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:405)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:358)
at
org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:326)
at
com.private.solr.server.SolrEmbeddedServer.initSolrEmbeddedServer(SolrEmbeddedServer.java:37)
Caused by: java.io.IOException: Keystore was tampered with, or password was
incorrect
at sun.security.provider.JavaKeyStore.engineLoad(Unknown Source)
at sun.security.provider.JavaKeyStore$JKS.engineLoad(Unknown Source)
at java.security.KeyStore.load(Unknown Source)
at
org.apache.http.conn.ssl.SSLSocketFactory.createSystemSSLContext(SSLSocketFactory.java:281)
at
org.apache.http.conn.ssl.SSLSocketFactory.createSystemSSLContext(SSLSocketFactory.java:366)
... 63 more
Caused by: java.security.UnrecoverableKeyException: Password verification
failed
... 68 more





--
View this message in context: 
http://lucene.472066.n3.nabble.com/After-Upgrade-to-4-3-EmbeddedServer-errors-with-SSL-context-error-tp4068253.html
Sent from the Solr - User mailing list archive at Nabble.com.