Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@h-c-a
Copy link
Contributor

@h-c-a h-c-a commented Jul 11, 2014

Added support plain stats.field and stats.calcdistinct (v 4.10)
https://cwiki.apache.org/confluence/display/solr/The+Stats+Component

*Added tests

@mausch
Copy link
Member

mausch commented Jul 11, 2014

Thanks for the pull request, I wrote a couple of comments in the commit.

*Added TryParse with invariant culture
@h-c-a
Copy link
Contributor Author

h-c-a commented Jul 21, 2014

I see the problem.Values returned by the stats component is dependent on the field type. ie string,date,numeric etc

here is how my results look like when i query on a

string field.

"stats": {
    "stats_fields": {
      "fs_heading": {
        "min": " Dansker har ramt guldåre i New York",
        "max": "Venturefonde giver millionstort rygklap til hundemission ",
        "count": 90,
        "missing": 0,
        "distinctValues": [
          "Tid til laaaaaangsomt tv",
          "Tid til langsomt tv",
          "Ulvetimer",
          "VOXPOP",
          "Venturefonde giver millionstort rygklap til hundemission",
          "Venturefonde giver millionstort rygklap til hundemission "
        ],
        "countDistinct": 72,
        "facets": {}
      }
    }
  }

Here the convert here would fail on the min/max

A date field

"stats": {
    "stats_fields": {
      "publishdate": {
        "min": "2014-07-16T00:00:00Z",
        "max": "2014-07-18T00:00:00Z",
        "count": 92,
        "missing": 0,
        "distinctValues": [
          "2014-07-16T00:00:00Z",
          "2014-07-17T00:00:00Z",
          "2014-07-18T00:00:00Z"
        ],
        "countDistinct": 3,
        "sum": "6067-11-07T00:00:00Z",
        "mean": "2014-07-17T13:49:33.913Z",
        "sumOfSquares": -345502333236027600000,
        "stddev": "NaN",
        "facets": {}
      }
    }
  }

here convert fails on min/max/stddev etc

A numeric field

  "stats": {
    "stats_fields": {
      "wordcount": {
        "min": 17,
        "max": 5365,
        "count": 92,
        "missing": 0,
        "distinctValues": [
          17,
          31,
          32,
        ],
        "countDistinct": 56,
        "sum": 89117,
        "sumOfSquares": 221201067,
        "mean": 968.6630434782609,
        "stddev": 1217.4406705509368,
        "facets": {}
      }
    }
  }

Based on these examples a try-parse with a default to null would be better.Or we could move min/max to generic type?

may be we should revisit this #118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.