Hi,

I index something like this:

<doc>
        <field name="name">Company A</field>
        <field name="cat">123</field>
        <field name="cat">456</field>
        <field name="cat">789</field>
</doc>

<doc>
        <field name="name">Company B</field>
        <field name="cat">129</field>
        <field name="cat">123</field>
        <field name="cat">987</field>
</doc>

So I ONLY want to display all category names starting with '12' and
how many companies are in each one.

In this example it should output:

name count
123  (2)
129  (1)


What I have now is:
http://localhost:8983/solr/select/?q=cat:12&facet=true&facet.limit=-1&facet.field=cat&facet.mincount=1

But with this I get all the categories which I would rather not prefer:

name count
123  (2)
456  (1) <-- Rather not get this information
789  (1) <-- Rather not get this information
129  (1)
987  (1) <-- Rather not get this information


Is there some way of achieving this in Solr?

Thanks alot!
Jon

Reply via email to