What does the face in Solr mean?

Could you explain to me what a line is? What I understood, suppose I have the following documents.

State Country karntaka India Bangalore India Delhi India Noida India 

It collapses several identical field values ​​into a single value and returns the number of times this value happened. Now, when I search in the "Country" field, then obviously I get 4 times in India. So I keep facet = on and facet.field = Country, with the motive of getting only one time in India, but when I made a request, getting
some strange result

 <lst name="responseHeader"> <int name="status">0</int> <int name="QTime">6</int> </lst> <result name="response" numFound="4" start="0"> <doc> <str name="country">India</str></doc> <doc> <str name="country">India</str></doc> <doc> <str name="country">India</str></doc> <doc> <str name="country">India</str></doc> </result> <lst name="facet_counts"> <lst name="facet_queries"/> <lst name="facet_fields"> <lst name="country"> <int name="a">4</int> <int name="d">4</int> <int name="di">4</int> <int name="dia">4</int> <int name="i">4</int> <int name="ia">4</int> <int name="in">4</int> <int name="ind">4</int> <int name="indi">4</int> <int name="india">4</int> </lst> </lst> <lst name="facet_dates"/> <lst name="facet_ranges"/> </lst> </response> 

Can anyone help me understand. Thanks

+6
source share
1 answer

If you had a Washington, USA record, the facet will report 4 results for India and 1 for USA .

Use the field type string . You seem to have used a (text) field with a subscript and n-gramming, which can benefit people who, for example, use India as an Indus. The string field is not processed this way and therefore is best suited for a field that needs to be faceted.

+3
source

All Articles