Permalink
Browse files

Make TokenizedStringNavigator (used for keyword search facet) active

check case insensitive.
As keywords are compared lower case, make sure user input keyword:Key
or keyword:key will be shown as active in facet entry key.
  • Loading branch information...
reger24 committed Dec 28, 2017
1 parent 270b770 commit f8071ac8ae14150b3671ba7df5537bc18e78f148
Showing with 14 additions and 0 deletions.
  1. +14 −0 source/net/yacy/search/navigator/TokenizedStringNavigator.java
@@ -26,6 +26,7 @@
import java.util.StringTokenizer;
import net.yacy.kelondro.data.meta.URIMetadataNode;
import net.yacy.search.Switchboard;
import net.yacy.search.query.QueryModifier;
import net.yacy.search.schema.CollectionSchema;
/**
@@ -77,4 +78,17 @@ public void incDoc(URIMetadataNode doc) {
}
}
}
/**
* Checks if query parameter/modifier with specific key is active.
* The comparison is case insensitive.
*
* @param modifier querymodifier to check
* @param key the key/term to check for
* @return true if the modifier contains the 'modifiername:key'
*/
@Override
public boolean modifieractive(final QueryModifier modifier, final String key) {
return modifier.toString().toLowerCase().contains(getQueryModifier(key));
}
}

0 comments on commit f8071ac

Please sign in to comment.