Project

General

Profile

« Previous | Next » 

Revision 3329

Added by Jing Tao over 17 years ago

Use or to replace union

View differences:

src/edu/ucsb/nceas/metacat/QueryTerm.java
229 229

  
230 230
        if(usePathIndex){
231 231
            // using xml_path_index table.....
232
        	if(notEqual == true){
233
        		self.append("SELECT DISTINCT docid from xml_path_index WHERE");
234
        		self.append(" docid NOT IN (Select docid FROM xml_path_index WHERE ");
235
        		self.append(searchexpr);
236
        		self.append("AND path LIKE '" + pathexpr + "') ");
232
        	if(notEqual == true ){
233
        		if (!inUnionGroup)
234
        		{
235
        			self.append("SELECT DISTINCT docid from xml_path_index WHERE");
236
        			self.append(" docid NOT IN (Select docid FROM xml_path_index WHERE ");
237
        			self.append(searchexpr);
238
        			self.append("AND path LIKE '" + pathexpr + "') ");
239
        		}
240
        		else
241
        		{
242
        			//if this is in union group we need to use "OR" to modify query
243
        			self.append("("+searchexpr);
244
        			self.append("AND path LIKE '" + pathexpr + "') ");
245
        		}
237 246
        	} else {
238
        		self.append("SELECT DISTINCT docid FROM xml_path_index WHERE ");
239
        		self.append(searchexpr);
240
        		self.append("AND path LIKE '" + pathexpr + "' ");	
247
        		if (!inUnionGroup)
248
        		{
249
        			self.append("SELECT DISTINCT docid FROM xml_path_index WHERE ");
250
        			self.append(searchexpr);
251
        			self.append("AND path LIKE '" + pathexpr + "' ");
252
        		}
253
        		else
254
        		{
255
        			//if this is in union group we need to use "OR" to modify query
256
        			self.append("("+searchexpr);
257
        			self.append("AND path LIKE '" + pathexpr + "') ");
258
        		}
241 259
        	}
242 260

  
243 261
        } else {

Also available in: Unified diff