Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does facet in Solr means?

Tags:

solr

Can you please explain me , what is facet ? What did I understand is , suppose I have following documents.

State  Country
karntaka India
Bangalore India
Delhi     India
Noida     India

It collapse multiple same value of field to a single value and returns number of times that value occurred. Now when i am search on field 'Country' then obviously I am getting 4 times India , So i keep facet=on and facet.field=Country, with a motive of getting only one time India , but when i fired query rather I am getting
some weird 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 any one help me to understand . Thanks

like image 745
voila Avatar asked Mar 29 '13 12:03

voila


People also ask

What is facet in query?

Faceted search, also called faceted navigation or faceted browsing, allows users who are running searches, to see a high-level breakdown of their search results, based upon one or more aspects, or facets of their documents. This allows users to select filters, to drill into those search results.

What is a facet in JSON?

Faceted search is about aggregating data and calculating metrics about that data. There are two main types of facets: Facets that partition or categorize data (the domain) into multiple buckets. Facets that calculate data for a given bucket (normally a metric, statistic or analytic function)

What is facet pivot in SOLR?

Solr faceting is used in many applications to give an overall idea about how the data resides in the index. Solr pivot faceting or decision tree faceting or sub faceting used to provide more details view of index data.

What is facet field?

Faceted fields are an important part of Insight. Simply explained, a facet is a field with an index built on it, and that index contains the unique values of the field. Just by looking at the values in a field with a facet, you can immediately see how many records have that value.


1 Answers

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

Use a string field type. You seem to have used a (text) field with lowercasing and n-gramming, which may benefit people who spell India as Inde, for example. A string field is not processed like this and therefore its best suited for a field meant to be faceted.

like image 122
Jesvin Jose Avatar answered Oct 31 '22 00:10

Jesvin Jose