Project

General

Profile

« Previous | Next » 

Revision 2836

Added by sgarg about 19 years ago

Added query for indexing attribute - needed for indexing packageId

View differences:

src/edu/ucsb/nceas/metacat/MetaCatServlet.java
266 266
                              "Inserting following path in xml_path_index: "
267 267
                              + (String)MetaCatUtil.pathsForIndexing
268 268
                                                   .elementAt(i));
269
    
270
                        pstmt = conn.prepareStatement("SELECT DISTINCT n.docid, "
271
                              + "n.nodedata, n.nodedatanumerical, n.parentnodeid"
272
                              + " FROM xml_nodes n, xml_index i WHERE"
273
                              + " i.path = ? and n.parentnodeid=i.nodeid and"
274
                              + " n.nodetype LIKE 'TEXT' order by n.parentnodeid");
269
   			if(((String)MetaCatUtil.pathsForIndexing.elementAt(i)).indexOf("@")<0){ 
270
                        	pstmt = conn.prepareStatement("SELECT DISTINCT n.docid, "
271
                              		+ "n.nodedata, n.nodedatanumerical, n.parentnodeid"
272
                              		+ " FROM xml_nodes n, xml_index i WHERE"
273
                              		+ " i.path = ? and n.parentnodeid=i.nodeid and"
274
                              		+ " n.nodetype LIKE 'TEXT' order by n.parentnodeid");
275
			} else {
276
                        	pstmt = conn.prepareStatement("SELECT DISTINCT n.docid, "
277
                              		+ "n.nodedata, n.nodedatanumerical, n.parentnodeid"
278
                              		+ " FROM xml_nodes n, xml_index i WHERE"
279
                              		+ " i.path = ? and n.nodeid=i.nodeid and"
280
                              		+ " n.nodetype LIKE 'ATTRIBUTE' order by n.parentnodeid");
281
			}
275 282
                        pstmt.setString(1, (String) MetaCatUtil.
276 283
                                        pathsForIndexing.elementAt(i));
277 284
                        pstmt.execute();

Also available in: Unified diff