Skip to content

Commit

Permalink
Remove groups field from the default field
Browse files Browse the repository at this point in the history
  • Loading branch information
LoayGhreeb committed Aug 28, 2024
1 parent e2c430b commit 05b6270
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.field.Field;
import org.jabref.model.entry.field.StandardField;
import org.jabref.model.search.LuceneIndexer;
import org.jabref.model.search.SearchFieldConstants;

Expand Down Expand Up @@ -83,6 +84,10 @@ private void addToIndex(BibEntry bibEntry) {
StringBuilder allFields = new StringBuilder(bibEntry.getType().getName());
for (Map.Entry<Field, String> mapEntry : bibEntry.getFieldMap().entrySet()) {
document.add(new TextField(mapEntry.getKey().getName(), mapEntry.getValue(), storeDisabled));
if (mapEntry.getKey().equals(StandardField.GROUPS)) {
// Do not add groups to the allFields field: https://github.com/JabRef/jabref/issues/7996
continue;
}
allFields.append('\n').append(mapEntry.getValue());
}
document.add(new TextField(SearchFieldConstants.DEFAULT_FIELD.toString(), allFields.toString(), storeDisabled));
Expand Down

0 comments on commit 05b6270

Please sign in to comment.