Solr syntax request syntax

I want to filter the number of facies in a multi-valued field (without documents)

For example:

select?q=*:*&rows=5&facet=true&facet.limit=5&facet.field=productID&facet.sort=true

is it possible to filter the calculations on my facet.field productId?

Given the previous request, I get:

<lst name="facet_counts">
<lst name="facet_queries"/>
<lst name="facet_fields">
<lst name="productID">
**<int name="EG7SpTw03mJ25vxS5jcB24">603</int>**
<int name="E53OBaX5hjGDAKzbHHaDG1">573</int>
<int name="sSLMrsA0wjLF8iWRAbzNq4">415</int>
<int name="ijcfPOTpg3eeGoXSW8h8L5">336</int>
<int name="Lij0a3kVgQzLxtOMgOXb06">296</int>
</lst>
</lst>
<lst name="facet_dates"/>
</lst>

I just want to filter the query to get the results, for example:

     - - 603 573 415 336 296            

 <lst name="facet_counts">
    <lst name="facet_queries"/>
    <lst name="facet_fields">
    <lst name="productID">
    <int name="E53OBaX5hjGDAKzbHHaDG1">573</int>
    <int name="sSLMrsA0wjLF8iWRAbzNq4">415</int>
    <int name="ijcfPOTpg3eeGoXSW8h8L5">336</int>
    <int name="Lij0a3kVgQzLxtOMgOXb06">296</int>
    <int name="Lij0a3kVgQzLxtOMYERESW">293</int>
    </lst>
    </lst>
    <lst name="facet_dates"/>
    </lst>

I just want to filter by product: EG7SpTw03mJ25vxS5jcB24 ...

THX

+3
source share
1 answer

Well, I found a solution, it just uses the facet.prefix parameter

select q =: & rows = 5 & facet = true & facet.limit = 5 & facet.field = PRODUCTID & facet.sort = true & facet.prefix = EG7SpTw03mJ25vxS5jcB24

The output I get is:

<lst name="facet_counts">
<lst name="facet_queries"/>
<lst name="facet_fields">
<lst name="taxonUUID">
<int name="EG7SpTw03mJ25vxS5jcB24">603</int>
</lst>
</lst>
<lst name="facet_dates"/>
</lst>

I am going to ask a new more complex question about this topic ...

+5
source

Source: https://habr.com/ru/post/1707944/


All Articles