Lucene / Solr: A facet is already a grand date field (boundary facet / facet / facet / hierarchical facet)

I am completely lost in the world of Solr links and terms. Currently, I have a date field that I am verging on, but I would like, if it were possible, "next." Example: Field: Date Field: Language

So, if I run this query:

http://host:port/solr/select/?q="Don Quijote"&sort=date+asc&facet=true&facet.date=date&facet.date.start=2010-09-01T00:00:00Z&facet.date.end=2010-09-04T23:59:59Z&facet.date.gap=%2B1DAY&facet.field=language&facet.mincount=1&start=0&rows=10 

I get 2 different faceted fields:

One for the "date" as

2010-09-01 (10)

2010-09-02 (4)

2010-09-03 (60)

2010-09-04 (7)

etc.

and one for 'language'

'English' (23)

'Spanish' (34)

'French' (32)

So my question is: how can I combine the results of the "language" field into daily statistics? I want at the end something like this:

2010-09-01 (10)

 'English' (4) 'Spanish' (5) 'French' (1) 

2010-09-02 (4)

 'English' (1) 'Spanish' (1) 'French' (2) 

2010-09-03 (60)

 'English' (20) 'Spanish' (20) 'French' (20) 

2010-09-04 (7)

 'English' (2) 'Spanish' (3) 'French' (1) 

Is it possible? I lost myself in terms of rotation, tried the facet.tree=date,language approach, and I'm not sure what I'm looking for is a "hierarchical aspect" ... Any pointers or guidance would be appreciated (but above all, and an example of how to do this with dates). Thanks!

Some links are read:

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

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

http://lucene.472066.n3.nabble.com/Hierarchical-Facets-td474308.html

http://lucene.472066.n3.nabble.com/Hierarchical-faceting-td1123548.html

http://www.craftyfella.com/2010/01/faceting-and-multifaceting-syntax-in.html

+4
source share
1 answer

I'm not sure if facet.tree can use date bounds. If you do not have many languages ​​(or dates), you can simply index the fields in one field through

 'date/lang' 

and then the face in this field only through facet.field = date_lang_merge_field

+3
source

Source: https://habr.com/ru/post/1335473/


All Articles