Can RavenDB faceted search somehow break down a facet into sub-facets? -
i pretty new faceted search, kind of difficult me wrap head around this... here goes:
pretend have item
contains collection of subitem
s , subitem
has enum indicates status - have enabled faceted search on categories on both item
, subitem
using index definition:
public class facetindexitems : abstractindexcreationtask<item> { public const string facetid = "facets/items"; public const string itemcategoryfacetname = "category"; public const string subitemcategoryfacetname = "subitems_category"; public facetindexitems() { map = items => item in items subitem in item.subitems select new { category = item.category, subitems_category = subitem.category }; } }
and facetsetup
:
new facetsetup { id = facetindexitems.facetid, facets = { new facet {name = facetindexitems.itemcategoryfacetname}, new facet {name = facetindexitems.subitemcategoryfacetname} } }
so far, good!
now, pretend subitem
has status
property - there way divide result of each facet different statuses?
e.g. quering data:
{ category: "wut", subitems: [ {category: "bim", status: "good"}, {category: "bim", status: "good"}, {category: "bim", status: "bad"} ] }
by item.category.in("wut") && item.subitems.any(s => s.category.in("bim"))
yield result like
{ category: { "good": 2 "bad": 1 }, subitems_category: { "good": 2 "bad": 1 } }
i unsure whether possible faceted search, , open alternatives if approach wrong.
you have generate different values each option, can't facet on more 1 field @ time. can generate fields @ indexing time, same thing.
Comments
Post a Comment