From: Wolfgang M. M. <wol...@us...> - 2004-07-14 19:03:38
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14412/src/org/exist/dom Modified Files: Match.java SortedNodeSet.java Log Message: Added optional term frequency counts to fulltext index. Index: Match.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/Match.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Match.java 29 Jan 2004 15:06:46 -0000 1.5 --- Match.java 14 Jul 2004 19:03:24 -0000 1.6 *************** *** 10,13 **** --- 10,15 ---- private String matchTerm; private long nodeId; + private int frequency = 1; + protected Match nextMatch = null; protected Match prevMatch = null; *************** *** 31,34 **** --- 33,44 ---- } + public void setFrequency(int freq) { + this.frequency = freq; + } + + public int getFrequency() { + return frequency; + } + public Match getNextMatch() { return nextMatch; Index: SortedNodeSet.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/SortedNodeSet.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** SortedNodeSet.java 28 May 2004 10:54:14 -0000 1.19 --- SortedNodeSet.java 14 Jul 2004 19:03:24 -0000 1.20 *************** *** 206,210 **** } ! private static final class IteratorItem implements Comparable { NodeProxy proxy; String value = null; --- 206,210 ---- } ! private static final class IteratorItem extends OrderedLinkedList.Node { NodeProxy proxy; String value = null; *************** *** 224,231 **** for(SequenceIterator i = seq.iterate(); i.hasNext(); ) { item = i.nextItem(); ! strings.add(item.getStringValue().toUpperCase()); } for (Iterator j = strings.iterator(); j.hasNext();) ! buf.append((String) j.next()); value = buf.toString(); } catch (XPathException e) { --- 224,231 ---- for(SequenceIterator i = seq.iterate(); i.hasNext(); ) { item = i.nextItem(); ! strings.add(new OrderedLinkedList.SimpleNode(item.getStringValue().toUpperCase())); } for (Iterator j = strings.iterator(); j.hasNext();) ! buf.append(((OrderedLinkedList.SimpleNode) j.next()).getData()); value = buf.toString(); } catch (XPathException e) { *************** *** 234,238 **** } ! public int compareTo(Object other) { IteratorItem o = (IteratorItem) other; if (value == null) --- 234,238 ---- } ! public int compareTo(OrderedLinkedList.Node other) { IteratorItem o = (IteratorItem) other; if (value == null) |