Terms facet question

Hi all,

Is it possible to do a terms facet of the terms matching a query (not on
the whole field) ? Like doing a terms facet on only the terms what would be
highlighted if I used the highlight feature with my query.

/DG

--

If you can easily identify the terms and there are not too many of them,
you can add a filter facethttp://www.elasticsearch.org/guide/reference/api/search/facets/filter-facet.htmlfor each term.

On Tuesday, January 8, 2013 5:36:13 PM UTC-5, logsta...@gmail.com wrote:

Hi all,

Is it possible to do a terms facet of the terms matching a query (not on
the whole field) ? Like doing a terms facet on only the terms what would be
highlighted if I used the highlight feature with my query.

/DG

--

Thank you for your answer Igor,
You mean doing this in two steps ?

  • a query with highlighting to identify the matching terms
  • a terms facet with a filter facet consisting of the list of highlighted
    terms
    So, is there a way to easily identify all the distinct matching terms of a
    query (in all the results), to put them in an array ? Additional work would
    be needed to collect highlighted terms and create an array of them.

However, isn't there a way to do what I want in one step ? (a facet on the
matching TERMS (not results) of a query) ?

Le mercredi 9 janvier 2013 01:46:28 UTC+1, Igor Motov a écrit :

If you can easily identify the terms and there are not too many of them,
you can add a filter facethttp://www.elasticsearch.org/guide/reference/api/search/facets/filter-facet.htmlfor each term.

On Tuesday, January 8, 2013 5:36:13 PM UTC-5, logsta...@gmail.com wrote:

Hi all,

Is it possible to do a terms facet of the terms matching a query (not on
the whole field) ? Like doing a terms facet on only the terms what would be
highlighted if I used the highlight feature with my query.

/DG

--

Unless I understood the original problem incorrectly, you could use a facet
with a facet filter, the filter being the original query that determines
the terms.

On Wed, Jan 9, 2013 at 12:59 AM, logstashuserx@gmail.com wrote:

Thank you for your answer Igor,
You mean doing this in two steps ?

  • a query with highlighting to identify the matching terms
  • a terms facet with a filter facet consisting of the list of highlighted
    terms
    So, is there a way to easily identify all the distinct matching terms of a
    query (in all the results), to put them in an array ? Additional work would
    be needed to collect highlighted terms and create an array of them.

However, isn't there a way to do what I want in one step ? (a facet on the
matching TERMS (not results) of a query) ?

Le mercredi 9 janvier 2013 01:46:28 UTC+1, Igor Motov a écrit :

If you can easily identify the terms and there are not too many of them,
you can add a filter facethttp://www.elasticsearch.org/guide/reference/api/search/facets/filter-facet.htmlfor each term.

On Tuesday, January 8, 2013 5:36:13 PM UTC-5, logsta...@gmail.com wrote:

Hi all,

Is it possible to do a terms facet of the terms matching a query (not on
the whole field) ? Like doing a terms facet on only the terms what would be
highlighted if I used the highlight feature with my query.

/DG

--

--