mitodl / lore

Learning Object Repository for Education
https://goo.gl/nDVx4D
GNU Affero General Public License v3.0
16 stars 6 forks source link

ability to facet on "not tagged" #591

Open pdpinch opened 9 years ago

pdpinch commented 9 years ago

As a curator, I would like an easy way to find all the learning resources that have not had any term applied in given vocabulary.

giocalitri commented 9 years ago

I tested this https://github.com/django-haystack/django-haystack/issues/824 and it works:

In [1]: from search.forms import SearchForm
In [2]: form = SearchForm(repo_slug='small', sortby='nr_views')
In [3]: res = form.search()
In [4]: len(res) # toy course
Out[4]: 18

# 2 terms have the vocabulary "color" set; the vocabulary "color" has ID=3
In [5]: missing = res.filter(_missing_='3_exact')
In [6]: len(missing)
Out[6]: 16

What's missing is how we plug this feature of Haystack to the UI: need to do some more research and tests.

The main problem I see is how to fetch the number without making additional requests to the backend

giocalitri commented 9 years ago

Plug statsd https://github.com/mitodl/lore/pull/494/files#diff-1b6759f04bef35c97141ab7bc4024a44R191

giocalitri commented 9 years ago

@Ferdi suggested to not put the missing number next to the Vocabulary label, but to create an additional entry in the list with term name "not tagged". this entry should eventually be styled differently.

cc @pdpinch

pdpinch commented 9 years ago

I updated the description to follow Giovanni's comment above, https://github.com/mitodl/lore/issues/591#issuecomment-139259659

pdpinch commented 9 years ago

@giocalitri did we ever do any statsd instrumentation on the "not tagged" term? What is your feeling about performance?

giocalitri commented 9 years ago

I put a decorator for the search API. I didn't look at the results.