Hello Valergi ,
This wont work , normally becuase the string would be tokenized into green
and energy.
If you use shingle token filter and set it as 2 , it might work.
Or in this case , you can see the position value of both the token using
the script and if its next to each other , you can take it as an
occurrence.
Thanks
Vineeth
On Tue, Oct 28, 2014 at 3:06 PM, <[email protected]> wrote:
> I want to access frequency of a phraze combined from multiple words e.g.
> "green energy"
>
> I can access tf of "green" and "energy", example:
>
> "function_score":
> {
> "filter" : {
> "terms" : { "content" : ["energy","green"]}
> },
> "script_score": {
> "script": "_index['content']['energy'].tf() +
> _index['content']['green'].tf()",
> "lang":"groovy"
> }
> }
>
> This works fine. However, how can I find the frequency of a term "green
> energy" as
>
> _index['content']['green energy'].tf() does not work
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/2e4388a4-72d6-4933-9686-304dea0727f1%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/2e4388a4-72d6-4933-9686-304dea0727f1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5mjK%3DbgdSEZvrsfz5d_HnN8BTrJ5d9O4yAHQuOODE4YWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.