Hi Ahmet,

> There is no built in solution for this.

Yes, I know, that's why I would like the TokenFilterFactory

> Two workaround :
> 
> 1) use facet.limit=-1 and invert the list (faceting response) at client side
> 
> 2) use multiples facet.query
>    a)facet.query=year:[2012 TO 2014]&facet.query=year:[2010 TO 2012] 
>    b)facet.query=year:2014&facet.query=year:2013 ...

I thought about these but they have the disadvantage that 1) could
return hundreds of facet entries. 2b) is better but would need about 30
facet-queries which makes quite a long URL and it wouldn't always work
as expected. There are subjects that were very popular in the past but
with no (or very few) recent publications. For these I would get empty
results for my 2014-1985 facet-queries but miss all the stuff from the
1960s.

>From all these thoughts I came to the conclusion that a custom
TokenFilterFactory could do exactly what I want. In effect it would give
me a reverse sort:
10000 - 2014 = 7986
10000 - 2013 = 7987
...
The client code can easily regain the original year values for display.

And I think it shouldn't be too difficult to write such a beast, only
problem is I am not a Java programmer. That is why I asked if someone
has done it already or if there is a guide I could use.
After all it is just a simple subtraction...

-Michael

Reply via email to