Is it possible to alias a facet field?

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

Is it possible to alias a facet field?

Jamie Johnson
I am looking to facet on a field in more than one way.  My data is of the form

7abcdefgh
7abcdefgi
7abcdefgj
7abcdefgk
7bbcdefgl
7bbcdefgm
7bbcdefgn

I want to get all of the counts for 7ab* and the max count for 7*.  I
had thought I could do this with an alias but I don't see how to do
this currently.  Is there a way to do this or should I just execute 2
queries?
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to alias a facet field?

Jamie Johnson
So this got me close

facet.field=testfield&facet.field=%7B!key=mylabel%7Dtestfield&f.mylabel.limit=1

but the limit on the alias didn't seem to work.  Is this expected?

On Sat, Jul 14, 2012 at 10:03 AM, Jamie Johnson <[hidden email]> wrote:

> I am looking to facet on a field in more than one way.  My data is of the form
>
> 7abcdefgh
> 7abcdefgi
> 7abcdefgj
> 7abcdefgk
> 7bbcdefgl
> 7bbcdefgm
> 7bbcdefgn
>
> I want to get all of the counts for 7ab* and the max count for 7*.  I
> had thought I could do this with an alias but I don't see how to do
> this currently.  Is there a way to do this or should I just execute 2
> queries?
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to alias a facet field?

Yonik Seeley-2-2
On Sat, Jul 14, 2012 at 10:12 AM, Jamie Johnson <[hidden email]> wrote:
> So this got me close
>
> facet.field=testfield&facet.field=%7B!key=mylabel%7Dtestfield&f.mylabel.limit=1
>
> but the limit on the alias didn't seem to work.  Is this expected?

Per-field params don't currently look under the alias.  I believe
there's a JIRA open for this.

-Yonik
http://lucidimagination.com
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to alias a facet field?

Chris Hostetter-3

: > facet.field=testfield&facet.field=%7B!key=mylabel%7Dtestfield&f.mylabel.limit=1
: >
: > but the limit on the alias didn't seem to work.  Is this expected?
:
: Per-field params don't currently look under the alias.  I believe
: there's a JIRA open for this.

https://issues.apache.org/jira/browse/SOLR-1351

There's a fairly old patch that covers some of the basics, but there are
some tricky edge cases that need to be accounted for and we need good
distributed tests to make sure things work properly.


-Hoss