generate two terms in facets

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

generate two terms in facets

Murilo de Souza Lopes
I am trying to generate two terms in the same facets, for example:

"terms": [{
         "term": "term value",
         "termtwo": "term value",
         "count": 0
       } ..


But only comes with 1 "term"

"terms": [{
         "term": "term value",
         "count": 0
       } ..

I've tried using the "multi fields", in indexing, but without success.

Anyone know of any examples or concept sure how to do this?

thank you

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: generate two terms in facets

dadoonet
Ask for two facets. One for each field.

My 2 cents

--
David ;-)
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 8 juin 2013 à 17:20, Murilo de Souza Lopes <[hidden email]> a écrit :

I am trying to generate two terms in the same facets, for example:

"terms": [{
         "term": "term value",
         "termtwo": "term value",
         "count": 0
       } ..


But only comes with 1 "term"

"terms": [{
         "term": "term value",
         "count": 0
       } ..

I've tried using the "multi fields", in indexing, but without success.

Anyone know of any examples or concept sure how to do this?

thank you

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: generate two terms in facets

Matt Weber-2
Or use the fields parameter on the terms facet which allows faceting over multiple fields.

{
    "query" : {
        "match_all" : {  }
    },
    "facets" : {
        "tags" : {
            "terms" : {
                "fields" : ["field1", "field2"]
            }
        }
    }
}


On Sat, Jun 8, 2013 at 9:48 AM, David Pilato <[hidden email]> wrote:
Ask for two facets. One for each field.

My 2 cents

--
David ;-)
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 8 juin 2013 à 17:20, Murilo de Souza Lopes <[hidden email]> a écrit :

I am trying to generate two terms in the same facets, for example:

"terms": [{
         "term": "term value",
         "termtwo": "term value",
         "count": 0
       } ..


But only comes with 1 "term"

"terms": [{
         "term": "term value",
         "count": 0
       } ..

I've tried using the "multi fields", in indexing, but without success.

Anyone know of any examples or concept sure how to do this?

thank you

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: generate two terms in facets

Murilo de Souza Lopes
In reply to this post by Murilo de Souza Lopes
I think the problem is the gem tire, because I'm trying to add + 1 terms in facet it is only generating 1.

someone working with the tire here?

Thanks for the replies.

Em sábado, 8 de junho de 2013 12h20min21s UTC-3, Murilo de Souza Lopes escreveu:
I am trying to generate two terms in the same facets, for example:

"terms": [{
         "term": "term value",
         "termtwo": "term value",
         "count": 0
       } ..


But only comes with 1 "term"

"terms": [{
         "term": "term value",
         "count": 0
       } ..

I've tried using the "multi fields", in indexing, but without success.

Anyone know of any examples or concept sure how to do this?

thank you

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: generate two terms in facets

Kiranpvuthaman
Hi All,

I also having a similar requirement. 
My collection have sub documents and the sub document contains three properties (Code, Description and Type). I basically wants to get distinct Code, Description and Type as TERM from the sub document (may be separated with some characters in between) and I want to display all three values in the interface.

Thanks in advance.
Regards,
Kiran




On Sunday, June 9, 2013 1:07:58 AM UTC+5:30, Murilo de Souza Lopes wrote:
I think the problem is the gem tire, because I'm trying to add + 1 terms in facet it is only generating 1.

someone working with the tire here?

Thanks for the replies.

Em sábado, 8 de junho de 2013 12h20min21s UTC-3, Murilo de Souza Lopes escreveu:
I am trying to generate two terms in the same facets, for example:

"terms": [{
         "term": "term value",
         "termtwo": "term value",
         "count": 0
       } ..


But only comes with 1 "term"

"terms": [{
         "term": "term value",
         "count": 0
       } ..

I've tried using the "multi fields", in indexing, but without success.

Anyone know of any examples or concept sure how to do this?

thank you

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: generate two terms in facets

sslhj
This post has NOT been accepted by the mailing list yet.
hi all,
   I have save requirement. my solution is, do term facet against each field, and add bool filter, which 'must' term filters against other fields, into it.

Kiranpvuthaman wrote
Hi All,

I also having a similar requirement.
My collection have sub documents and the sub document contains three
properties (Code, Description and Type). I basically wants to get distinct
Code, Description and Type as TERM from the sub document (may be separated
with some characters in between) and I want to display all three values in
the interface.

Thanks in advance.
Regards,
Kiran




On Sunday, June 9, 2013 1:07:58 AM UTC+5:30, Murilo de Souza Lopes wrote:
>
> I think the problem is the gem tire, because I'm trying to add + 1 terms
> in facet it is only generating 1.
>
> someone working with the tire here?
>
> Thanks for the replies.
>
> Em sábado, 8 de junho de 2013 12h20min21s UTC-3, Murilo de Souza Lopes
> escreveu:
>>
>> I am trying to generate two terms in the same facets, for example:
>>
>> "terms": [{
>>          "term": "term value",
>>          "termtwo": "term value",
>>          "count": 0
>>        } ..
>>
>>
>> But only comes with 1 "term"
>>
>> "terms": [{
>>          "term": "term value",
>>          "count": 0
>>        } ..
>>
>> I've tried using the "multi fields", in indexing, but without success.
>>
>> Anyone know of any examples or concept sure how to do this?
>>
>> thank you
>>
>

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: generate two terms in facets

sujoysett
In reply to this post by Kiranpvuthaman
Hi

I did it by using scripts and parsing the response at client side.

{
    "size": 0,
    "facets": {
        "my_facet": {
            "terms": {
                "script_field": "_source.field1 + ' ~~~ ' + _source.field2",
                "size": 10
            }
        }
    }
}

Possible to do on any number of fields, but this concepts does not work so great when nested arrays or multi-valued fields are involved.
Also its memory intensive.

- Sujoy.


On Sunday, June 9, 2013 2:12:41 AM UTC+5:30, Kiran Uthaman wrote:
Hi All,

I also having a similar requirement. 
My collection have sub documents and the sub document contains three properties (Code, Description and Type). I basically wants to get distinct Code, Description and Type as TERM from the sub document (may be separated with some characters in between) and I want to display all three values in the interface.

Thanks in advance.
Regards,
Kiran




On Sunday, June 9, 2013 1:07:58 AM UTC+5:30, Murilo de Souza Lopes wrote:
I think the problem is the gem tire, because I'm trying to add + 1 terms in facet it is only generating 1.

someone working with the tire here?

Thanks for the replies.

Em sábado, 8 de junho de 2013 12h20min21s UTC-3, Murilo de Souza Lopes escreveu:
I am trying to generate two terms in the same facets, for example:

"terms": [{
         "term": "term value",
         "termtwo": "term value",
         "count": 0
       } ..


But only comes with 1 "term"

"terms": [{
         "term": "term value",
         "count": 0
       } ..

I've tried using the "multi fields", in indexing, but without success.

Anyone know of any examples or concept sure how to do this?

thank you

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: generate two terms in facets

Murilo de Souza Lopes
thanks for the tip


2013/6/10 Sujoy Sett <[hidden email]>
Hi

I did it by using scripts and parsing the response at client side.

{
    "size": 0,
    "facets": {
        "my_facet": {
            "terms": {
                "script_field": "_source.field1 + ' ~~~ ' + _source.field2",
                "size": 10
            }
        }
    }
}

Possible to do on any number of fields, but this concepts does not work so great when nested arrays or multi-valued fields are involved.
Also its memory intensive.

- Sujoy.


On Sunday, June 9, 2013 2:12:41 AM UTC+5:30, Kiran Uthaman wrote:
Hi All,

I also having a similar requirement. 
My collection have sub documents and the sub document contains three properties (Code, Description and Type). I basically wants to get distinct Code, Description and Type as TERM from the sub document (may be separated with some characters in between) and I want to display all three values in the interface.

Thanks in advance.
Regards,
Kiran




On Sunday, June 9, 2013 1:07:58 AM UTC+5:30, Murilo de Souza Lopes wrote:
I think the problem is the gem tire, because I'm trying to add + 1 terms in facet it is only generating 1.

someone working with the tire here?

Thanks for the replies.

Em sábado, 8 de junho de 2013 12h20min21s UTC-3, Murilo de Souza Lopes escreveu:
I am trying to generate two terms in the same facets, for example:

"terms": [{
         "term": "term value",
         "termtwo": "term value",
         "count": 0
       } ..


But only comes with 1 "term"

"terms": [{
         "term": "term value",
         "count": 0
       } ..

I've tried using the "multi fields", in indexing, but without success.

Anyone know of any examples or concept sure how to do this?

thank you

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Murilo de Souza Lopes

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.