0
votes

I need to implement in Marklogic a multi-facet selection navigation system. The problem is that when I select a value V1 in a facet F1, the facet returned in the facet-results includes only the value v1 and ommits the other values (I use the serach API with constraint options). Is there a way to say to the search API to return all values in the facet independing on the selected value.

Note that I have multiple facets abd so the values returned need to be adapted the selected filters/values.

Here is my query when I select a value:

 search:{    options: { 
    constraint : [{name:'n1',...}, {name:'n2',...}, {name:'n3',...},...]   },   qtext: "the text query",   query: {
     and-query:{
       queries:[range-constraint-query:{constraint-name:"n1",....}]
     }   } }
1
Don't you think facet counts would be confusing if you start doing this? - grtjn
Here is an example of what I want to implement : cdiscount.com/informatique/ssd/…. As you can see, you can choose different capacities, brands... - Mehdi
Yes, not an uncommon pattern. The facet counts can still be confusing, as the facet counts no longer represent subsets of the current search result. Something similar has been implemented though.. - grtjn

1 Answers

0
votes

If you are using Server-Side JavaScript, rather than XQuery, the JSearch API has an "othersWhere" capability that I think might meet your needs. Take a look at http://docs.marklogic.com/guide/search-dev/javascript#id_88888.