I'm looking for the facet values themselves. Trying to create a UI that is driven by the actual data available from the facets.
Ok I will look into the two pass approach From: [email protected] [mailto:[email protected]] On Behalf Of Justin Makeig Sent: Thursday, July 18, 2013 5:53 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] Return 0 Count Facet Rows Are you asking about the facets (e.g. Color) or the facet _values_ themselves (Red, Green, Blue, etc.)? Danny's answer was geared towards the facets. If you want to get zeros for the facet values you're going to have to run a second unconstrained query and do some set intersection to find the values that don't show up in your constrained facet. Doable with some cts:element-values and maps, but not currently built into the Search API. (Technically the set of values that don't appear in your constrained facet values is infinite, but I imagine you're asking about the finite set that appears in your entire data set.) Justin On Jul 18, 2013, at 3:43 PM, <[email protected]<mailto:[email protected]>> wrote: I did this. The constraints come back as I had passed them in, but the results still omit the index entries that have a count of 0. I just get the entries that return hits. From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Danny Sokolsky Sent: Thursday, July 18, 2013 5:35 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] Return 0 Count Facet Rows The way I can think of to do this is to use <return-constraints>true</return-constraints>, which will give you a list of all of the constraints. Then you can take all of the range constraints that are faceted and have some logic that looks through each faceted named constraint and, if there is no search:facet with that name, then make an entry with no content for that named constraint. My guess is it would take 10 or 20 lines of code to do that. -Danny From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf [email protected]<mailto:[email protected]> Sent: Thursday, July 18, 2013 3:04 PM To: [email protected]<mailto:[email protected]> Subject: [MarkLogic Dev General] Return 0 Count Facet Rows I am using the search API to populate some data. I had the notion to use the facet results to drive the UI controls on the screen. Our business wants the controls to remain even if there are no results for a given facet item. However, when I start drilling down results, obviously there are 0 results for some of the items. Marklogic does not include those in the search response, which makes sense most of the time. However, I would like them to show up. How can I get it to pass back entries in the index that have a count of 0? Thanks _______________________________________________ General mailing list [email protected]<mailto:[email protected]> http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
