Hello,
given the following document structure (books as parent, libraries having these 
books as children) in a Solr 7.3.1 server:

<update>
    <add>
        <doc>
            <field name="doc_type_s">book</field>
            <field name="id">1000</field>
            <field name="title_t">Mr. Mercedes</field>
            <field name="autor_t">Stephen King</field>
            <doc>
                <field name="doc_type_s">library</field>
                <field name="id">1000/100</field>
                <field name="acquisition_date_i">20160810</field>
                <field name="city_t">Innsbruck</field>
            </doc>
            <doc>
                <field name="doc_type_s">library</field>
                <field name="id">1000/101</field>
                <field name="acquisition_date_i">20180103</field>
                <field name="city_t">Hall</field>
            </doc>
        </doc>
        <doc>
            <field name="doc_type_s">book</field>
            <field name="id">1001</field>
            <field name="title_t">Noah</field>
            <field name="autor_t">Sebastian Fitzek</field>
            <doc>
                <field name="doc_type_s">library</field>
                <field name="id">1001/100</field>
                <field name="acquisition_date_i">20170810</field>
                <field name="city_t">Innsbruck</field>
            </doc>
        </doc>
    </add>
</update>


Now I want to query with a filter-query on the acquisition_date_i field oft he 
child-documents and get parent documents as a result:

fq={!parent which=doc_type_s:book} acquisition_date_i:20180626

This works as expected.


Now for some reason I want to exclude the above filter-query from a 
facet-query. Therefore I need to add a tag to the filter-query:

q={!tag=datefilter}{!parent which=doc_type_s:book} acquisition_date_i:20180626 
....

And now the error occures: Just by adding "{!tag=datefilter}" to the query 
makes the result now contain child-documents.
I seems like the "{!parent which=doc_type_s:book}" does not work anymore as 
soon as I add "{!tag=datefilter}" before it.

When I put the "{!tag=datefilter}" after "{!parent which=doc_type_s:book}" then 
the result is correct again (result contains parent documents) but now the 
exclude in the facet-query does not work anymore.

So the question is: how can I apply a parent- and a tag-filter to a 
filter-query?


Thanks for your help.

Florian

Reply via email to