{% for genre in genres %}
{ "wildcard": { "Book.Genres" : {{ genre }} }},
{% endfor %}
{ genres: ["4kvmcwpf0f2ry5r0nxeps5t3dh","4ecpyyskvgnt244m6xa08pd7m2"] }
OrchardCore.DisplayManagement.Razor.IOrchardDisplayHelper _orchard;
public DemoModel(OrchardCore.DisplayManagement.Razor.IOrchardDisplayHelper orchard)
{
_orchard = orchard;
}
{
"size": 10,
"query": {
"bool": {
"must": [
{% if genres %}
{"match": {
"Book.Genres": {
"query":"{% for genre in genres %}{{genre}} {% endfor %}",
"operator": "or"
}
}
},
{% endif %}
{% if agegroups %}
{"match": {
"Book.AgeGroups": {
"query":"{% for agegroup in agegroups %}{{agegroup}} {% endfor %}",
"operator": "or"
}
}
},
{% endif %}
{% if geographies %}
{"match": {
"Book.Geography": {
"query":"{% for geography in geographies %}{{geography}} {% endfor %}",
"operator": "or"
}
}
},
{% endif %}
{% if represenationgroups %}
{"match": {
"Book.RepresentationGroups": {
"query": "{% for group in represenationgroups %}{{group}} {% endfor %}",
"operator": "or"
}
}
}
{% endif %}
]
}
}
}