Skip to content

No mapping found for [_score] in order to sort on [DATAES-467] #1044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Jun 14, 2018 · 2 comments
Closed
Labels
type: bug A general bug

Comments

@spring-projects-issues
Copy link

Petar Tahchiev opened DATAES-467 and commented

Hello all.. with spring-boot-parent 2.0.2.RELEASE my code works fine, however with 2.0.3-BUILD-SNAPSHOT I get this error from elasticsearch:

2018-06-14 10:43:38,845 org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/storefront].[dispatcherServlet] [https-jsse-nio-127.0.0.1-8112-exec-4] ERROR: Servlet.service() for servlet [dispatcherServlet] in context with path [/storefront] threw exception [Request processing failed; nested exception is Failed to execute phase [dfs], all shards failed; shardFailures {[b8hjxXp7S5m9PNcIMBRRdg][products][0]: RemoteTransportException[[b8hjxXp][local[1]][indices:data/read/search[phase/dfs]]]; nested: QueryShardException[No mapping found for [_score] in order to sort on]; }{[b8hjxXp7S5m9PNcIMBRRdg][products][1]: RemoteTransportException[[b8hjxXp][local[1]][indices:data/read/search[phase/dfs]]]; nested: QueryShardException[No mapping found for [_score] in order to sort on]; }{[b8hjxXp7S5m9PNcIMBRRdg][products][2]: RemoteTransportException[[b8hjxXp][local[1]][indices:data/read/search[phase/dfs]]]; nested: QueryShardException[No mapping found for [_score] in order to sort on]; }{[b8hjxXp7S5m9PNcIMBRRdg][products][3]: RemoteTransportException[[b8hjxXp][local[1]][indices:data/read/search[phase/dfs]]]; nested: QueryShardException[No mapping found for [_score] in order to sort on]; }{[b8hjxXp7S5m9PNcIMBRRdg][products][4]: RemoteTransportException[[b8hjxXp][local[1]][indices:data/read/search[phase/dfs]]]; nested: QueryShardException[No mapping found for [_score] in order to sort on]; }] with root cause
[products/ppPVwKKeSkmIZQ2Y-_tEpQ] QueryShardException[No mapping found for [_score] in order to sort on]
    at org.elasticsearch.search.sort.FieldSortBuilder.build(FieldSortBuilder.java:262)
    at org.elasticsearch.search.sort.SortBuilder.buildSort(SortBuilder.java:156)
    at org.elasticsearch.search.SearchService.parseSource(SearchService.java:634)
    at org.elasticsearch.search.SearchService.createContext(SearchService.java:485)
    at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:461)

After googling I found this: https://discuss.elastic.co/t/sort-by--score-error-in-es5-1-1/71340/2
where it says: I‘m using the java api,and found that ’SortBuilders has new function call scoreSort,i use this solve the problem(original use fieldSort with "_score").

I use the spring-data API like this:

new Sort(order.getDirection(), "_score");

perhaps you need a new if the customer is trying to sort on _score don't use FieldSort but instead the new way scoreSort


Referenced from: pull request #209, and commits 020b5e1, 37bc97d, ba3eba5, b51a370

Backported to: 3.0.9 (Kay SR9)

@spring-projects-issues
Copy link
Author

Petar Tahchiev commented

Guys the fix needs to be backported to Kay too

@spring-projects-issues
Copy link
Author

Sascha Woo commented

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant