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.
pull/154/head
reger 7 years ago
parent 270b77074e
commit f8071ac8ae

@ -26,6 +26,7 @@ import java.util.Collection;
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 class TokenizedStringNavigator extends StringNavigator implements Naviga
}
}
}
/**
* 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));
}
}

Loading…
Cancel
Save