Hello <@U01PL2YSG8L> I have a schema with a `type...
# community-help
h
Hello @Kishore Nallan I have a schema with a
type
field that can have three different values:
collection
,
page
, and
blogs
. I'm using
facet_by
with the
type
field, which only provides counts. However, I need to retrieve all other fields, like
title
and
description
, for all documents. I want to avoid using
filter_by
and running three separate queries. Please provide a solution I have attached my documents
k
You have to run independent facets for each field as separate requests.
But you can send them as a single multi search request.
h
{ "searches": [ { "collection": "hussain-new-store_79302033713-collection-page-blog", "q": "*", "include_filds":"id,body_html,title,type", "query_by": "title", "filter_by":"type:collection", "pre_segmented_query": true, "text_match_type": "max_weight", "prioritize_token_position": true, "use_cache": true }, { "collection": "hussain-new-store_79302033713-collection-page-blog", "q": "*", "include_filds":"id,body_html,title,type", "query_by": "title", "filter_by":"type:blog", "pre_segmented_query": true, "text_match_type": "max_weight", "prioritize_token_position": true, "use_cache": true }, { "collection": "hussain-new-store_79302033713-collection-page-blog", "q": "*", "include_filds":"id,body_html,title,type", "query_by": "title", "filter_by":"type:page", "pre_segmented_query": true, "text_match_type": "max_weight", "prioritize_token_position": true, "use_cache": true } ] } i have to use like this right ?
f
You can take a look at how this demo does it. It uses Instantsearch, which automatically takes care of this for you when sending over the requests. Otherwise, check a request sent over using the network tab in your browser, to see how exactly it's structured
h
ok i'll check