Re: Term Facet count rounding


(Shay Banon) #1

There is no logic to do any rounding, so strange if you get it. First, ti recommended not to specify such a large size. Though in practice, in this case, it does not hurt, in other cases things can be pre allocated based on the provided size.

Can you provide a recreation?
On Tuesday, May 17, 2011 at 7:35 PM, Ben Roubicek wrote:

I am doing faceted search using ES 0.16 and getting term facet counts that appear to be rounded in the results. Is there any way to force the exact count to be returned?

Query:
{
"size":0,
"query":{
"constant_score":{
"filter":{
"bool":{
"must":{
"or":{
"filters":[
{
"term":{
"attr_str.company_job_title":"Homemaker"
}
},
{
"term":{
"attr_str.company_job_title":"Doctor"
}
}
]
}
}
}
}
}
},
"facets":{
"attr_str.fields":{
"terms":{
"field":"attr_str.fields",
"size":2147483647
}
}
}
}

Result
{
"took":107,
"timed_out":false,
"_shards":{
"total":5,
"successful":5,
"failed":0
},
"hits":{
"total":313000,
"max_score":1.0,
"hits":[

]
},
"facets":{
"attr_str.fields":{
"type":"terms",
"missing":2961590,
"terms":[
{
"term":"attr_str_loc.geolocation",
"count":313000
},
{
"term":"attr_str.state",
"count":313000
},
{
"term":"attr_str.list_type",
"count":313000
},
{
"term":"attr_str.list_name",
"count":313000
},
{
"term":"attr_str.last_name",
"count":313000
},
{
"term":"attr_str.individual_occupation",
"count":313000
},
{
"term":"attr_str.individual_gender",
"count":313000
},
{
"term":"attr_str.first_name",
"count":313000
},
{
"term":"attr_str.family_member_position",
"count":313000
},
{
"term":"attr_str.email",
"count":313000
},
{
"term":"attr_str.company_job_title",
"count":313000
},
{
"term":"attr_str.anglers_indv_code",
"count":313000
},
{
"term":"attr_lng_rng_title.individual_age",
"count":313000
},
{
"term":"attr_lng_rng_title.household_income",
"count":313000
},
{
"term":"attr_lng_rng_title.home_value",
"count":313000
},
{
"term":"attr_lng_rng_title.home_purchase_price",
"count":313000
},
{
"term":"attr_lng_rng_title.hh_ages_present",
"count":313000
},
{
"term":"attr_str.individual_ethnicity",
"count":312000
},
{
"term":"attr_str.wealth_decile",
"count":311000
},
{
"term":"attr_str.interest_lifestyle",
"count":311000
},
{
"term":"attr_str.consumer_purchase_methods",
"count":311000
},
{
"term":"attr_lng_rng_title.hh_length_of_residence",
"count":311000
},
{
"term":"attr_lng_rng_title.household_number_of_persons",
"count":310000
},
{
"term":"attr_str.interest_reading",
"count":309000
},
{
"term":"attr_str.home__owner
/_renter_code",
"count":309000
},
{
"term":"attr_str.interest_sports",
"count":308000
},
{
"term":"attr_str.household_marital_status",
"count":308000
},
{
"term":"attr_str.purchase_interest",
"count":307000
},
{
"term":"attr_str.credit_cards_owned",
"count":307000
},
{
"term":"attr_lng_rng_title.household_number_of_adults",
"count":307000
},
{
"term":"attr_str.interest_hobbies",
"count":306000
},
{
"term":"attr_str.dwell_type",
"count":304000
},
{
"term":"attr_str.household_education_level",
"count":302000
},
{
"term":"attr_str.contributor_interest",
"count":301000
},
{
"term":"attr_str.interest_musical",
"count":299000
},
{
"term":"attr_str.religion",
"count":294000
},
{
"term":"attr_str.propensity_to_contribute",
"count":291000
},
{
"term":"attr_str.interest_investment",
"count":283000
},
{
"term":"attr_lng_rng_title.number_of_children",
"count":283000
},
{
"term":"attr_str.travel_preference",
"count":279000
},
{
"term":"attr_lng_rng_title.year_home_built",
"count":264000
},
{
"term":"attr_str.presence_of_children",
"count":241000
},
{
"term":"attr_lng_rng_title.discretionary_spending_index",
"count":236000
},
{
"term":"attr_lng_rng_title.credit_rating",
"count":236000
},
{
"term":"attr_str.pet_ownership",
"count":225000
},
{
"term":"attr_lng_rng_title.num_of_housing_units",
"count":206000
},
{
"term":"attr_str.political_affiliation",
"count":203000
},
{
"term":"attr_lng_rng_title.purchase_year",
"count":181000
},
{
"term":"attr_str.person_type",
"count":156000
},
{
"term":"attr_str.voter",
"count":154000
},
{
"term":"attr_str.refinance_indicator",
"count":143000
},
{
"term":"attr_str.mortgage_or_refinance_loan_type",
"count":139000
},
{
"term":"attr_str.type_of_home_purchase",
"count":133000
},
{
"term":"attr_str.soho_indicator",
"count":117000
},
{
"term":"attr_str.vehicle_ownership",
"count":92000
},
{
"term":"attr_str.type_of_fuel",
"count":90000
},
{
"term":"attr_str.home_air_conditioning",
"count":90000
},
{
"term":"attr_str.home_pool_type",
"count":70000
},
{
"term":"attr_str.presence_of_fireplace",
"count":49000
},
{
"term":"attr_lng_rng_title.mortgage_term_months",
"count":45000
},
{
"term":"attr_str.mortgage_or_refinance_interest_rate_type",
"count":38000
},
{
"term":"attr_str.gender_of_children",
"count":16000
},
{
"term":"attr_str.hispanic_origin",
"count":8000
},
{
"term":"attr_str.number_of_finance_loans",
"count":7000
},
{
"term":"attr_str.individual_spoken_language",
"count":5000
}
]
}
}
}


(system) #2