Mercurial Hosting > junotu
changeset 99:40f1ea8f49ef
Hidden fields are not indexed into default search field anymore
Thus searching for '_junotu_title', 'junotu' or 'title' will no longer return all cards as matches. It will only return those cards that have those strings in the title, content, or visible tags.
author | Fox |
---|---|
date | Wed, 05 Apr 2023 21:36:27 +0200 |
parents | 778130f1a4c4 |
children | f52a4c112d79 |
files | src/junotu/Database.java src/junotu/Main.java |
diffstat | 2 files changed, 18 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/junotu/Database.java Tue Mar 21 01:30:52 2023 +0100 +++ b/src/junotu/Database.java Wed Apr 05 21:36:27 2023 +0200 @@ -164,11 +164,23 @@ for( String tag : card.tags.keySet() ) { Set<Object> values = card.tags.get( tag ); for( Object value : values ) { - if( value == null ) { - search += tag+" "; - } else { - search += tag+" "+value.toString()+" "; + + /* Building analyzed-only search tag. */ + if( + ( tag.equals(Card.TAG_TITLE) || tag.equals(Card.TAG_CONTENT) ) + && value != null + + ) { + search += value.toString()+" "; + + } else if( tag.length() == 0 || tag.charAt(0) != '_' ) { + if( value == null ) { + search += tag+" "; + } else { + search += tag+" "+value.toString()+" "; + } } + if( value == null || "".equals(value) ) { if( !tag.equals("") ) { /* It seems that if a field with empty string value is analyzed, it isn't searchable at all. */