Hello,

 

Thanks very much for your answer.

 

I'll have a look at SimpleFacets.java to look at patching it. I should think 
the sorting bit will be relatively straightforward. The tricky bit is how to 
submit the request via the query interface - there's only a boolean

for facet sorting - would probably require a new parameter so as to maintain bw 
compatilibity [e.g. &facet.reversesort=true] (if you have any thoughts on how 
you would like to see such functionality integrated into a query, let me know). 
When I have something working, I'll probably have to ask you the best way to 
submit a patch for this.

 

The use case is pretty straightforward, really:

 

In my case, the index is collecting/storing network events (logs, firewall 
events, Win event logs etc.).

 

The reverse facet query is for when you want to know which event (or group of 
event types) has happened the least

over a given period of time.

 

As a simple example:

Let's say you want to look at who has been logging in to a secure server over 
the past week, and this server is normally

accessed by only a handful of users.

But you don't want to know the 'typical' users that have logged in, you want to 
know who's only logged-in once, at say

3 o'clock in the morning on Wednesday. Hmmm, why's he/she doing that?

 

Here, a 'rare' query will show you the atypical behaviour.

 

Capacity Planning and Performance Monitoring is another example - where you 
might want to know which machines have 

produced the least number of errors or the least amount of traffic.

 

Outside of networking, stock control would be another example - 'what items are 
we about to run out of?'

 

Thanks,

Peter

 

 

 
> Date: Tue, 15 Dec 2009 13:12:44 -0800
> From: hossman_luc...@fucit.org
> To: solr-user@lucene.apache.org
> Subject: Re: Reverse sort facet query
> 
> 
> : Does anyone know of a good way to perform a reverse-sorted facet query 
> (i.e. rarest first)?
> 
> I'm fairly confident that code doesn't exist at the moment. 
> 
> If i remember correctly, it would be fairly simply to implement if you'd 
> like to submit a patch: when sorting by count a simple bounded priority 
> queue is used, so we'd just have the change the comparator. If you're 
> interested in working on a patch it should be in SimpleFacets.java. I 
> think the queue is called "BoundedTreeSet"
> 
> 
> (that's a pretty novel request actually ... i don't remember anyone else 
> ever asking for anything like this before .. can you describe your use 
> case a bit -- i'm curious as to how/when you would use this data)
> 
> 
> 
> -Hoss
> 
                                          
_________________________________________________________________
Use Hotmail to send and receive mail from your different email accounts
http://clk.atdmt.com/UKM/go/186394592/direct/01/

Reply via email to