How to configure TermsFacet?


(Wojciech Durczyński) #1

Hello

I have following usecase:
I'd like to create TermsFacet which will return all possible terms
(just like global facet), but numbers should be taken from current
query/filtering (just like in non-global facet).
In other words: my facet should work just like usual non-global
TermsFacet, but in results there should be always all possible terms
for particular field (probably most of them with count 0).

How to achieve this functionality? Maybe it should be included in ES
just like global facets are?

Regards
Wojciech Durczyński


(Shay Banon) #2

There isn't an option to do this today. How many terms are we talking about
per field (in general)?

2010/12/15 Wojciech Durczyński wojciech.durczynski@comarch.com

Hello

I have following usecase:
I'd like to create TermsFacet which will return all possible terms
(just like global facet), but numbers should be taken from current
query/filtering (just like in non-global facet).
In other words: my facet should work just like usual non-global
TermsFacet, but in results there should be always all possible terms
for particular field (probably most of them with count 0).

How to achieve this functionality? Maybe it should be included in ES
just like global facets are?

Regards
Wojciech Durczyński


(Wojciech Durczyński) #3

That's only for category purposes (not analyzed text field) so I think
it'd be usually less than 10 terms.
I'd like to implement an object browser with facet-based filtering.
When somebody restricts search to objects of one category, then other
categories should be returned also for him to change his selection.

Additionally it would be perfect to have a possibility of defining two
types of filters:
strong filters - one kind of filter that always restricts browsed
objects (user isn't allowed to see these objects at all)
weak filters - second kind of filter that limits browsed objects (user
selects a filter to limit shown objects).

Then facet values should be calculated that way:

  1. documents in index are restricted by strong filters
  2. check what terms exists in those set of documents - they will be
    facet values (terms) to return
  3. restrict documents by weak filters
  4. calculate document counts for terms from 2. and return all those
    values (even zeros)

What do you think about that functionality? Is it possible to
implement?

On Dec 16, 8:18 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

There isn't an option to do this today. How many terms are we talking about
per field (in general)?

2010/12/15 Wojciech Durczyński wojciech.durczyn...@comarch.com

Hello

I have following usecase:
I'd like to create TermsFacet which will return all possible terms
(just like global facet), but numbers should be taken from current
query/filtering (just like in non-global facet).
In other words: my facet should work just like usual non-global
TermsFacet, but in results there should be always all possible terms
for particular field (probably most of them with count 0).

How to achieve this functionality? Maybe it should be included in ES
just like global facets are?

Regards
Wojciech Durczyński


(Shay Banon) #4

Heya,

Its certainly possible to implement. Can you open an issue for this? I
plan to work more on facets to make them more easily pluggable and
extensible, and this can be one of the enhancements.

-shay.banon

2010/12/17 Wojciech Durczyński wojciech.durczynski@comarch.com

That's only for category purposes (not analyzed text field) so I think
it'd be usually less than 10 terms.
I'd like to implement an object browser with facet-based filtering.
When somebody restricts search to objects of one category, then other
categories should be returned also for him to change his selection.

Additionally it would be perfect to have a possibility of defining two
types of filters:
strong filters - one kind of filter that always restricts browsed
objects (user isn't allowed to see these objects at all)
weak filters - second kind of filter that limits browsed objects (user
selects a filter to limit shown objects).

Then facet values should be calculated that way:

  1. documents in index are restricted by strong filters
  2. check what terms exists in those set of documents - they will be
    facet values (terms) to return
  3. restrict documents by weak filters
  4. calculate document counts for terms from 2. and return all those
    values (even zeros)

What do you think about that functionality? Is it possible to
implement?

On Dec 16, 8:18 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

There isn't an option to do this today. How many terms are we talking
about
per field (in general)?

2010/12/15 Wojciech Durczyński wojciech.durczyn...@comarch.com

Hello

I have following usecase:
I'd like to create TermsFacet which will return all possible terms
(just like global facet), but numbers should be taken from current
query/filtering (just like in non-global facet).
In other words: my facet should work just like usual non-global
TermsFacet, but in results there should be always all possible terms
for particular field (probably most of them with count 0).

How to achieve this functionality? Maybe it should be included in ES
just like global facets are?

Regards
Wojciech Durczyński


(Wojciech Durczyński) #5

Issue created:

On Dec 19, 1:46 am, Shay Banon shay.ba...@elasticsearch.com wrote:

Heya,

Its certainly possible to implement. Can you open an issue for this? I
plan to work more on facets to make them more easily pluggable and
extensible, and this can be one of the enhancements.

-shay.banon

2010/12/17 Wojciech Durczyński wojciech.durczyn...@comarch.com

That's only for category purposes (not analyzed text field) so I think
it'd be usually less than 10 terms.
I'd like to implement an object browser with facet-based filtering.
When somebody restricts search to objects of one category, then other
categories should be returned also for him to change his selection.

Additionally it would be perfect to have a possibility of defining two
types of filters:
strong filters - one kind of filter that always restricts browsed
objects (user isn't allowed to see these objects at all)
weak filters - second kind of filter that limits browsed objects (user
selects a filter to limit shown objects).

Then facet values should be calculated that way:

  1. documents in index are restricted by strong filters
  2. check what terms exists in those set of documents - they will be
    facet values (terms) to return
  3. restrict documents by weak filters
  4. calculate document counts for terms from 2. and return all those
    values (even zeros)

What do you think about that functionality? Is it possible to
implement?

On Dec 16, 8:18 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

There isn't an option to do this today. How many terms are we talking
about
per field (in general)?

2010/12/15 Wojciech Durczyński wojciech.durczyn...@comarch.com

Hello

I have following usecase:
I'd like to create TermsFacet which will return all possible terms
(just like global facet), but numbers should be taken from current
query/filtering (just like in non-global facet).
In other words: my facet should work just like usual non-global
TermsFacet, but in results there should be always all possible terms
for particular field (probably most of them with count 0).

How to achieve this functionality? Maybe it should be included in ES
just like global facets are?

Regards
Wojciech Durczyński


(system) #6