You could run it once with your query using <return-results>true</return-results> and <return-facets>false</return-facets>, and then do a second call without the query, using <return-results>false</return-results> and <return-facets>true</return-facets>.
________________________________________ From: [email protected] [[email protected]] On Behalf Of Geert Josten [[email protected]] Sent: Thursday, May 10, 2012 9:03 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] efficient use search:search for facetting Hi Jakob, There is no flag or option that you can supply to search:search that makes it do what you want. And even if it would, it would have to do a double call itself too. Since search:search is such fast, I don't think it does any harm to call it twice. Just make sure you skip snippeting, and anything else that is irrelevant. Kind regards, Geert > -----Oorspronkelijk bericht----- > Van: [email protected] [mailto:general- > [email protected]] Namens Jakob Fix > Verzonden: donderdag 10 mei 2012 13:31 > Aan: General Mark Logic Developer Discussion > Onderwerp: [MarkLogic Dev General] efficient use search:search for facetting > > Hi, > > I'm doing the usual application where you have the facets listed on > the side of the search results and you can select from there one (or > more) to filter the results. > > However, search:search only returns the facet values for which it finds hits. > > Is there a way to return *all* available facet values, even those with > zero occurrences? > > Right now the only way I've found is to call search:search twice and > then combine the result. > > cheers, > Jakob. > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
