Project

General

Profile

« Previous | Next » 

Revision 47759

EQUAL case handled as AND of terms instead of OR

View differences:

modules/cnr-cql-utils/trunk/src/main/java/eu/dnetlib/functionality/cql/parse/TermNode.java
5 5
import java.util.List;
6 6
import java.util.Map;
7 7
import java.util.Map.Entry;
8
import java.util.StringTokenizer;
9 8

  
10 9
import com.google.common.base.Function;
11 10
import com.google.common.base.Joiner;
12 11
import com.google.common.base.Splitter;
12
import com.google.common.collect.BiMap;
13
import com.google.common.collect.HashBiMap;
13 14
import com.google.common.collect.Iterables;
15
import com.google.common.collect.Maps;
14 16
import org.apache.commons.lang.StringUtils;
15 17
import org.apache.lucene.queryparser.classic.QueryParserBase;
16 18

  
17
import com.google.common.collect.BiMap;
18
import com.google.common.collect.HashBiMap;
19
import com.google.common.collect.Maps;
20

  
21 19
public class TermNode extends Node {
22 20

  
23 21
	public static final String dnetDefaultField = "__all";
......
60 58
		case EXACT:
61 59
			final String lucene = getFieldName() + ":" + "\"" + value + "\"";
62 60
			return StringUtils.isNotBlank(weight()) ? lucene + weight() + " " + expand(value) : lucene;
61
		case EQUAL:
63 62
		case ALL:
64 63
			return "(" + handleTokens(termTokenizer, "AND") + " " + expandTokens(weightTokenizer) + ")";
65
		case EQUAL:
66 64
		case ANY:
67 65
			return "(" + handleTokens(termTokenizer, "OR") + " " + expandTokens(weightTokenizer) + ")";
68 66
		case NOT:

Also available in: Unified diff