I am using solr 6.2.1. Is json.facet supported there? If not, is there a
way to combine the 2 queries into a single query in solr 6.2.1? In the
example I mentioned, could you please help me form a sample query where I
can facet on both parent as well as child docs?
Thanks,
Soham
On Wed, Jul 18, 2018 at 1:35 PM, Mikhail Khludnev wrote:
> child.facet.field works if parent query goes as q ie q={!parent
> which="doc_type:parent"}color:blue.
> However, it's considered as deprecated and proposed to be replaced with
> json.facet and uniqueBlock
>
> On Wed, Jul 18, 2018 at 7:04 AM soham gandhi
> wrote:
>
> > Hi,
> >
> > I am working on a query that must return parent docs and facet on both
> the
> > parent and child fields. Here's a sample doc-
> >
> > 1
> > merc
> > car
> > sagandhi
> > 2
> > 3
> > parent
> >
> > 2
> > child
> > S
> > blue
> >
> >
> > 3
> > Z
> > 25
> > child
> >
> >
> > I want to search for "merc" or "*" and return facets for type/user from
> > parent docs, and code/color from child docs. Currently I am not using
> > blockjoin. Instead I make two queries, one on the parent docs and the
> other
> > on the child docs. I get the applicable child_id from the first query and
> > feed it into the second query to get the child facets.
> > However this has impacted performance and is not scalable if the
> child_ids
> > I get are huge. Is there a way to combine the two queries using block
> join.
> > I tried this query -
> > q=*:* =user:sagandhi ={!parent
> > which="doc_type:parent"}color:blue=type
> facet.field=code
> >
> > I get this error - Block join faceting is allowed with
> > ToParentBlockJoinQuery only
> >
> > Am I missing something here? Any pointers please.
> >
> > Thanks,
> > Soham
> >
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>