Skip to content
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

Add config parameter to increase elasticsearch index.max_result_window #3234

Closed

Conversation

tuomari
Copy link

@tuomari tuomari commented Feb 6, 2020

When fetching over 10000 issues through api ( /api/issues/search?p=21&ps=-1 ), elasticsearch fails with exception Result window is too large, from + size must be less than or equal to: [10000] but was [10500]. Increasing index.max_result_window will allow fetching of all issues for a project.

For example IntelliJ Idea sonarqube plugin (https://github.com/sonar-intellij-plugin/sonar-intellij-plugin) will fail if there are over 10000 issues in a project..

@ghost
Copy link

ghost commented Feb 6, 2020

DeepCode's analysis on #6f2da0 found:

  • 0 critical issues. ⚠️ 0 warnings and 0 minor issues. ✔️ 0 issues were fixed.

💬 This comment has been generated by the DeepCode bot, installed by the owner of the repository. The DeepCode bot protects your repository by detecting and commenting on security vulnerabilities or other critical issues.


☺️ If you want to provide feedback on our bot, here is how to contact us.

@sns-seb
Copy link
Contributor

sns-seb commented Feb 7, 2020

Hello,

Increasing index.max_result_window is not fixing the problem, only pushing it a bit further away, at the cost of memory (see index.max_result_window at https://www.elastic.co/guide/en/elasticsearch/reference/6.8/index-modules.html#dynamic-index-settings) and bad performance.

WS api/issues/search should rather be fixed to use ES's scroll API.

Anyway, it's questionable whether it makes sense to display more than 10k issues per project at all without putting in any extra filter (issue type at least), and even more in an IDE.

@inoreip
Copy link

inoreip commented May 1, 2020

Hi

Can we at least make sonarqube honour any settings in the elasticsearch.yml file on startup. It seems strange you cannot tailor the search index behaviour to a particular deployment. Even if these properties are defined in SonarQube.properties file.

@vanderby
Copy link

vanderby commented May 6, 2020

While this PR does make this ES setting a first class citizen, it is not needed. If you enable ES's http port by setting sonar.search.httpPort you can then make a PUT request to change any ES setting. A more detailed walkthrough can be found at: vanderby/SonarQube-AzureAppService#40 (comment)

Depending on how your setup with SQ is, you may want to disable the ES http port after the change so you don't keep the endpoint open to the public internet.

@ghost ghost requested a review from jacek-poreda-sonarsource April 8, 2021 09:13
@ghost ghost removed the request for review from michal-duda-sonarsource April 8, 2021 09:13
@ghost
Copy link

ghost commented Apr 8, 2021

Hey @jacek-poreda-sonarsource, could you handle this one, please?

@jacek-poreda-sonarsource
Copy link
Contributor

Hello @tuomari ,

Thanks for the contribution, but as @sns-seb mentioned, it is not fixing root of the problem, just postponing it further.

Also with the current state of Elasticsearch API I'm unsure if scroll api should be used here either, hence I'm closing that PR.

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.

6 participants