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

Change lucene index path to have sub directories #9887

Merged
merged 11 commits into from
May 15, 2023
Merged

Conversation

koppor
Copy link
Member

@koppor koppor commented May 14, 2023

Follow-up to #9584. Fixes https://github.com/JabRef/jabref-issue-melting-pot/issues/93.

Lucene-Index is now stored in lucence/<version>.

├───backups
├───logs
│   ├───100.0.0
│   ├───5.10--2023-04-06--0111d59
│   └───5.9--2023-01-04--bc3b9892f
├───lucene
│   └───95
│       ├───-369469544
│       └───40622060
└───ssl

Thus, %APPDATA%\..\Local\org.jabref looks more clean to the user

Discussion was done at #9676.

Upgrade from lucene94 to 95 was done after release of JabRef v5.9 and thus this change does not affect users basing on the release version. They will encounter a re-index in all cases.

Compulsory checks

Preview Give feedback

return Path.of(AppDirsFactory.getInstance().getUserDataDir(OS.APP_DIR_APP_NAME, SearchFieldConstants.VERSION, OS.APP_DIR_APP_AUTHOR));
return Path.of(AppDirsFactory.getInstance()
.getUserDataDir(OS.APP_DIR_APP_NAME,
"lucene" + File.separator + SearchFieldConstants.VERSION,
Copy link
Member

Choose a reason for hiding this comment

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

Use private static final String FILE_SEPARATOR = System.getProperty("file.separator");
from OS.java in

Copy link
Member Author

Choose a reason for hiding this comment

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

image

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed the unused variable. I didn't want to be the first one using it. 😇

Copy link
Member

Choose a reason for hiding this comment

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

Then use the nio variant: String separator = FileSystems.getDefault().getSeparator();

calixtus
calixtus previously approved these changes May 14, 2023
Copy link
Member

@Siedlerchr Siedlerchr left a comment

Choose a reason for hiding this comment

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

see comment

@calixtus
Copy link
Member

Os class has to be rewritten, unifying access to all filesystem and os variables

@Siedlerchr
Copy link
Member

Os class has to be rewritten, unifying access to all filesystem and os variables

For that we have JabrefDeskop with the sublcaseses

@calixtus
Copy link
Member

calixtus commented May 15, 2023

Yes, so JabrefDesktop needs to be fixed. I don't like calling appdirs or environment vars directly in this class. It should keep the level of abstraction.

@koppor
Copy link
Member Author

koppor commented May 15, 2023

I don't like calling appdirs or environment vars directly in this class. It should keep the level of abstraction.

Moved the code to NativeDesktop at 6148974 (#9887).

@github-actions
Copy link
Contributor

Your code currently does not meet JabRef's code guidelines. The tool reviewdog already placed comments on GitHub to indicate the places. See the tab "Files" in you PR. Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues.

More information on code quality in JabRef is available at https://devdocs.jabref.org/getting-into-the-code/development-strategy.html.

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label May 15, 2023
Copy link
Member

@Siedlerchr Siedlerchr left a comment

Choose a reason for hiding this comment

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

Merging now as we have lucene 9.6 ugprade

@Siedlerchr Siedlerchr merged commit 73329f4 into main May 15, 2023
@Siedlerchr Siedlerchr deleted the improve-lucene-path branch May 15, 2023 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants