Skip to content

[indexPattern] added _score as a default meta field#4105

Merged
spalger merged 2 commits intoelastic:masterfrom
spalger:implement/scoreAsMetaField
Jun 17, 2015
Merged

[indexPattern] added _score as a default meta field#4105
spalger merged 2 commits intoelastic:masterfrom
spalger:implement/scoreAsMetaField

Conversation

@spalger
Copy link
Copy Markdown
Contributor

@spalger spalger commented Jun 4, 2015

While looking into #4012 I noticed that you can't even select _score as a sort field right now. This is because the doc_viewer checks that the sorts field belongs to the indexPattern. This is a generally good behavior, so I figured it would make sense to add _score as one of the default _metaFields.

For now, you can see this in action by opening up a fresh instance of discover and changing the sort field to _score

image
image

@w33ble
Copy link
Copy Markdown
Contributor

w33ble commented Jun 4, 2015

When using an index pattern that was created before the changing, handling of the _score field is a little odd, since the field doesn't exist in the mapping, but does show up in Discover

How much of a problem this is though, I don't know.

screenshot 2015-06-04 10 29 42

screenshot 2015-06-04 10 30 11

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a show-stopper, but adding an exception by field name here is unfortunate. Since this field is being forced into the mapping, it seems like there should be a property we could set that would indicate that it's sortable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you in principle, but there really is no other field like _score (in that they are always sortable) and I feel like whatever property we add to the spec will equal spec.name === '_score' anyway.

@w33ble w33ble assigned spalger and unassigned w33ble Jun 4, 2015
@w33ble
Copy link
Copy Markdown
Contributor

w33ble commented Jun 4, 2015

Overall this LGTM, just concerned about the handling of _score for existing index patterns so I wanted to pass it back to get a response on that.

@spalger
Copy link
Copy Markdown
Contributor Author

spalger commented Jun 17, 2015

Opened #4256 to track you ask about adding _score to existing patterns.

@spalger
Copy link
Copy Markdown
Contributor Author

spalger commented Jun 17, 2015

Merged master, once the tests pass I'll merge this.

spalger added a commit that referenced this pull request Jun 17, 2015
[indexPattern] added _score as a default meta field
@spalger spalger merged commit 523c199 into elastic:master Jun 17, 2015
@rashidkpc rashidkpc added v4.1.2 and removed v4.1.1 labels Jul 22, 2015
@rashidkpc rashidkpc mentioned this pull request Jul 22, 2015
@spalger spalger deleted the implement/scoreAsMetaField branch July 31, 2015 04:54
@w33ble w33ble mentioned this pull request Sep 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants