You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Yago Riveiro <ya...@gmail.com> on 2015/12/11 17:46:05 UTC
How Json facet API works with domains and facet functions?
Hi,
How the json facet api works with domains and facet functions?
I try to google some info and I do not find nothing useful.
How can do a query that find all parents that match a clause (a date) and
calculate the avg price of all of children that have property X?
Following yonik's blog example I try something like this:
http://localhost:8983/solr/query?q={!parent
which="parent_type:ecommerce"}date:2015-12-11T00:00:00Z&json.facet={x:'avg(price)',
domain: { blockChildren : "parent_type:ecommerce"}}
but doesn't work.
-----
Best regards
--
View this message in context: http://lucene.472066.n3.nabble.com/How-Json-facet-API-works-with-domains-and-facet-functions-tp4244907.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: How Json facet API works with domains and facet functions?
Posted by Yago Riveiro <ya...@gmail.com>.
One more question.
It’s posisble use the domain clause in json facet without a term query?
Ex.
json.facet={
x:'avg(price)',
domain: { blockChildren : "parent_type:ecommerce”}
}
This make any sense, or I always should reduce the domain using the query and filters.
—/Yago Riveiro
On Fri, Dec 11, 2015 at 5:17 PM, Yonik Seeley <ys...@gmail.com> wrote:
> If you search on the parents and want to match child documents, I
> think you want {!child} and not {!parent} in your queries or filters.
> fq={!child of=...}date_query_on_parents
> fq=child_prop:X
> For this specific example, you don't even need the block-join support
> in facets since the base domain (query+filters) will already be the
> child docs you want to facet over.
> -Yonik
> On Fri, Dec 11, 2015 at 11:46 AM, Yago Riveiro <ya...@gmail.com> wrote:
>> Hi,
>>
>> How the json facet api works with domains and facet functions?
>>
>> I try to google some info and I do not find nothing useful.
>>
>> How can do a query that find all parents that match a clause (a date) and
>> calculate the avg price of all of children that have property X?
>>
>> Following yonik's blog example I try something like this:
>>
>> http://localhost:8983/solr/query?q={!parent
>> which="parent_type:ecommerce"}date:2015-12-11T00:00:00Z&json.facet={x:'avg(price)',
>> domain: { blockChildren : "parent_type:ecommerce"}}
>>
>> but doesn't work.
>>
>>
>>
>> -----
>> Best regards
>> --
>> View this message in context: http://lucene.472066.n3.nabble.com/How-Json-facet-API-works-with-domains-and-facet-functions-tp4244907.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
Re: How Json facet API works with domains and facet functions?
Posted by Yonik Seeley <ys...@gmail.com>.
If you search on the parents and want to match child documents, I
think you want {!child} and not {!parent} in your queries or filters.
fq={!child of=...}date_query_on_parents
fq=child_prop:X
For this specific example, you don't even need the block-join support
in facets since the base domain (query+filters) will already be the
child docs you want to facet over.
-Yonik
On Fri, Dec 11, 2015 at 11:46 AM, Yago Riveiro <ya...@gmail.com> wrote:
> Hi,
>
> How the json facet api works with domains and facet functions?
>
> I try to google some info and I do not find nothing useful.
>
> How can do a query that find all parents that match a clause (a date) and
> calculate the avg price of all of children that have property X?
>
> Following yonik's blog example I try something like this:
>
> http://localhost:8983/solr/query?q={!parent
> which="parent_type:ecommerce"}date:2015-12-11T00:00:00Z&json.facet={x:'avg(price)',
> domain: { blockChildren : "parent_type:ecommerce"}}
>
> but doesn't work.
>
>
>
> -----
> Best regards
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-Json-facet-API-works-with-domains-and-facet-functions-tp4244907.html
> Sent from the Solr - User mailing list archive at Nabble.com.