diff options
| author | reger <reger18@arcor.de> | 2014-01-30 22:57:27 +0100 |
|---|---|---|
| committer | reger <reger18@arcor.de> | 2014-01-30 22:57:27 +0100 |
| commit | b693ce9759eed46f0ea9620de9aa8010fbf29e4b (patch) | |
| tree | ae58372101ccc017456d521e09fd04aaaad57d3e /source | |
| parent | cb71413d197bbaef056a72af5c61f50beb77f7db (diff) | |
allow combining selection of different search nav's (facets)
- selecting more than one nav combines the 2 selections (with AND)
- unselecting one nav clears all selected
(e.g. select filetype:pdf and /language/fr shows ~ french pdf's only)
Diffstat (limited to 'source')
| -rw-r--r-- | source/net/yacy/search/query/QueryParams.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/net/yacy/search/query/QueryParams.java b/source/net/yacy/search/query/QueryParams.java index 1a2e9ca6e..b0a5023d2 100644 --- a/source/net/yacy/search/query/QueryParams.java +++ b/source/net/yacy/search/query/QueryParams.java @@ -615,7 +615,8 @@ public final class QueryParams { * @param theQuery search query
* @param newModifier optional new modifier.
* - if null existing modifier of theQuery is appended
- * - if not null this new modifier is appended (overwriting existing modifier)
+ * - if not null this new modifier is appended in addition to existing modifier
+ * - if isEmpty overwrites (clears) existing modifier
* @return url to new search result page
*/
public static StringBuilder navurlBase(final String ext, final QueryParams theQuery, final String newModifier) {
@@ -629,7 +630,10 @@ public final class QueryParams { if (newModifier == null) {
if (!theQuery.modifier.isEmpty()) sb.append("+" + theQuery.modifier.toString());
} else {
- if(!newModifier.isEmpty()) sb.append("+" + newModifier);
+ if(!newModifier.isEmpty()) {
+ if (!theQuery.modifier.isEmpty()) sb.append("+" + theQuery.modifier.toString());
+ sb.append("+" + newModifier);
+ }
}
sb.append("&maximumRecords=");
|
