Time for action – using range queries and facet range queries

Starting from the faceting principles seen, we may be curious about the possibility to obtain terms in the facets by range. This is possible and very simple to test on numerical values, such as height and width in our case:

>> curl -X 'http://localhost:8983/solr/paintings/select?q=*:*&fq=height:[100%20TO%20200]&fl=title&rows=1&facet=true&facet.range=height&facet.range=width&facet.range.start=0&facet.range.end=400&facet.range.gap=40&json.nl=map&wt=json'

What just happened?

By now, the facet mechanism has become clearer, and it should seem much simpler than in the beginning. The fact is, when using facets, we look at data "in advance", or if you prefer, we could think we are collecting data classified in some way, in order to choose a direction to move into this simple classified word. To be honest, I don't like the usage of the term classification in the context of faceting. I'd rather prefer using terms such as aspects or similar but at the moment, I'm more interested in focusing on the idea behind it.

Here, it's important to avoid missing a simple principle here; facet ranges are best used when you play with them from a web interface, and specifically, a slider widget is very often the best interaction to give to the user for changing the range parameters.

The parameters, by themselves, are quite simple; with facet.range=width we decided to use the field width for range faceting, and we will need a start, end, and step value, which we will define using facet.range.start, facet.range.end, and facet.range.gap respectively. It's not a big deal. Once more we will use this functionality in conjunction with filter query (in this case, the query is a range query too) in order to construct a navigation inside the data by performing subsequent queries. The filter query part could also be seen as a kind of memory of where we are now on the data, in some way, as it temporarily fixes our context. The filter query could change from time to time, depending on what we will discover using facets, facet ranges, and facet queries.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.172.132