-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Lucene search backend #8963
Lucene search backend #8963
Conversation
A user might have deleted a link to a fulltext-file in the source tex file and we need to reflect that change in the index as well.
HashMap<String, Float> boosts = new HashMap<String, Float>(); | ||
SearchFieldConstants.searchableBibFields.stream().forEach(field -> boosts.put(field, Float.valueOf(4))); | ||
|
||
if (query.getSearchFlags().contains(SearchRules.SearchFlags.FULLTEXT)) { | ||
Arrays.stream(SearchFieldConstants.PDF_FIELDS).forEach(field -> boosts.put(field, Float.valueOf(1))); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easy, but ugly. Maybe define a boost property for the standard Fields and get that by Field-name?
Very nice to see this implemented! A few comments from my side:
|
Would definitely reduce coding effort and migration code.
Thought about that too, maybe with the option for power-users to show floats instead. I am very bad at UI design though, did not get good feedback whenever I implemented something, so would need some help with that.
Thats true, but filtering kind of defeats the purpose of a fulltext/fuzzy search IMO. Where do you draw the line for the filtering predicate? Score==0? In large libraries that will result in a table with lots of "bad" search results with scores slightly above 0 and people could need to scroll to find much better matches.
In any case, we would need to have a very nice way to display the score if we do not sort on it, so users can still tell better fits apart. |
gradlew clean? |
Gradlew clean fixed the compilation, but now I get the following errors whenever I try to open a library:
and
|
hm, interesting, can reproduce the bug on my windows machine, but not on my arch linux laptop |
# Conflicts: # CHANGELOG.md # src/main/java/org/jabref/model/search/rules/ContainsBasedSearchRule.java # src/main/java/org/jabref/model/search/rules/GrammarBasedSearchRule.java # src/main/java/org/jabref/model/search/rules/RegexBasedSearchRule.java
# Conflicts: # CHANGELOG.md # src/main/java/org/jabref/model/search/rules/ContainsBasedSearchRule.java # src/main/java/org/jabref/model/search/rules/GrammarBasedSearchRule.java # src/main/java/org/jabref/model/search/rules/RegexBasedSearchRule.java
The build of this PR is available at https://builds.jabref.org/pull/8963/merge. |
|
I will just mention this my old comment here as well, so that it is not forgotten: #4237 (comment) I have noted that for the Lucene search approach (#8963 (comment)), the following solution has been suggested to the 'floating mode' problem:
I am not familiar with the technicalities of Lucene, but I reckon a score of 0 represents an item, that does not match the search criteria at all. That is not (!) the same as what the old floating mode in JabRef 3.8.2 offered - the items in gray did match the search criteria to a certain degree. The only difference between the items with white background and those with gray background was, that the white ones belonged to the group, that the user had selected at the moment. The gray ones did not (!) belong to the selected group. Hopefully, this old behaviour of JabRef can be restored with the new Lucene search. |
Some notes on the search syntax. Users might find it confusing if partial-word-search is not the default search. See laurent22/joplin#6349 and laurent22/joplin#6455 for discussions in a related project. Full search documentation of Joplin: https://joplinapp.org/help/apps/search |
* Fix selecting group triggers in all open libraries * Change color of the search modifier buttons for dark theme #8963 (comment) * Add shortcut to open global search window "Ctrl+shift+F" * fix keep on top subscription * Fix context menu of the search bar * Store preview divider position in global search window Remove constructor * prevent NPE * Fix update search query triggers in all open libraries * Adapt GUI test * Clear search highlight in SourceTab after resetting search query * Revert "Fix update search query triggers in all open libraries" This reverts commit d6d455c. * Revert "Fix selecting group triggers in all open libraries" This reverts commit b0017fb. * Remove regexValidator * listen for changes for search flags --------- Co-authored-by: Siedlerchr <siedlerkiller@gmail.com>
Follow-up PR: #11542 |
First draft of the switch to the Lucene Search Backend
Whats working
Todo
Follow-ups
Problems:
Fixes #8857
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)