Skip to content

Avoid overloading default search type to dfs_query_then_fetch? #1884

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
jtibshirani opened this issue Jul 27, 2021 · 1 comment · Fixed by #1913
Closed

Avoid overloading default search type to dfs_query_then_fetch? #1884

jtibshirani opened this issue Jul 27, 2021 · 1 comment · Fixed by #1913
Labels
type: enhancement A general enhancement

Comments

@jtibshirani
Copy link

jtibshirani commented Jul 27, 2021

Unless it's specified, the search type is set to dfs_query_then_fetch:

protected SearchType searchType = SearchType.DFS_QUERY_THEN_FETCH;

The default search type in Elasticsearch itself is query_then_fetch. Compared to this Elasticsearch default, dfs_query_then_fetch performs an extra round trip to the nodes before starting the main search to gather term frequency information. In general, the dfs_query_then_fetch type is only used in special situations where exact text scoring is important.

To avoid adding the extra roundtrip, AbstractQuery could fall back to the Elasticsearch default instead of setting dfs_query_then_fetch.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 27, 2021
@jtibshirani jtibshirani changed the title Avoid overloading default search type to dfs_query_and_fetch? Avoid overloading default search type to dfs_query_then_fetch? Jul 27, 2021
@sothawo sothawo added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 27, 2021
@sothawo
Copy link
Collaborator

sothawo commented Jul 27, 2021

Thanks for finding this. That value has been in there since this property was added in Spring Data Elasticsearch back in march 2014 - nowadays nobody knows why it was set to this value then.

This will be cleaned up together with the changes of #1885

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

Successfully merging a pull request may close this issue.

3 participants