source: sandbox/expresso-solr/solr/docs/api/org/apache/solr/handler/dataimport/XPathRecordReader.html @ 7588

Revision 7588, 25.0 KB checked in by adir, 11 years ago (diff)

Ticket #000 - Adicionando a integracao de buscas com Solr na base a ser isnerida na comunidade

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<!--NewPage-->
3<HTML>
4<HEAD>
5<!-- Generated by javadoc (build 1.6.0_24) on Mon Jun 25 15:26:26 EDT 2012 -->
6<META http-equiv="Content-Type" content="text/html; charset=utf-8">
7<TITLE>
8XPathRecordReader (Solr 4.0.0-ALPHA API)
9</TITLE>
10
11<META NAME="date" CONTENT="2012-06-25">
12
13<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
14
15<SCRIPT type="text/javascript">
16function windowTitle()
17{
18    if (location.href.indexOf('is-external=true') == -1) {
19        parent.document.title="XPathRecordReader (Solr 4.0.0-ALPHA API)";
20    }
21}
22</SCRIPT>
23<NOSCRIPT>
24</NOSCRIPT>
25
26</HEAD>
27
28<BODY BGCOLOR="white" onload="windowTitle();">
29<HR>
30
31
32<!-- ========= START OF TOP NAVBAR ======= -->
33<A NAME="navbar_top"><!-- --></A>
34<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
35<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
36<TR>
37<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
38<A NAME="navbar_top_firstrow"><!-- --></A>
39<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
40  <TR ALIGN="center" VALIGN="top">
41  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
42  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
43  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
44  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/XPathRecordReader.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
45  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
46  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
47  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
48  </TR>
49</TABLE>
50</TD>
51<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
52</EM>
53</TD>
54</TR>
55
56<TR>
57<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
58&nbsp;<A HREF="../../../../../org/apache/solr/handler/dataimport/XPathEntityProcessor.html" title="class in org.apache.solr.handler.dataimport"><B>PREV CLASS</B></A>&nbsp;
59&nbsp;<A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.Handler.html" title="interface in org.apache.solr.handler.dataimport"><B>NEXT CLASS</B></A></FONT></TD>
60<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
61  <A HREF="../../../../../index.html?org/apache/solr/handler/dataimport/XPathRecordReader.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62&nbsp;<A HREF="XPathRecordReader.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
63&nbsp;<SCRIPT type="text/javascript">
64  <!--
65  if(window==top) {
66    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
67  }
68  //-->
69</SCRIPT>
70<NOSCRIPT>
71  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
72</NOSCRIPT>
73
74
75</FONT></TD>
76</TR>
77<TR>
78<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
79  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
80<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
81DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
82</TR>
83</TABLE>
84<A NAME="skip-navbar_top"></A>
85<!-- ========= END OF TOP NAVBAR ========= -->
86
87<HR>
88<!-- ======== START OF CLASS DATA ======== -->
89<H2>
90<FONT SIZE="-1">
91org.apache.solr.handler.dataimport</FONT>
92<BR>
93Class XPathRecordReader</H2>
94<PRE>
95<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
96  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.solr.handler.dataimport.XPathRecordReader</B>
97</PRE>
98<HR>
99<DL>
100<DT><PRE>public class <B>XPathRecordReader</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
101</PRE>
102
103<P>
104<p>
105 A streaming xpath parser which uses StAX for XML parsing. It supports only
106 a subset of xpath syntax.
107 </p><pre>
108 /a/b/subject[@qualifier='fullTitle']
109 /a/b/subject[@qualifier=]/subtag
110 /a/b/subject/@qualifier
111 //a
112 //a/b...
113 /a//b
114 /a//b...
115 /a/b/c
116 </pre>
117 A record is a Map&lt;String,Object&gt; . The key is the provided name
118 and the value is a String or a List<String>
119
120 This class is thread-safe for parsing xml. But adding fields is not
121 thread-safe. The recommended usage is to addField() in one thread and
122 then share the instance across threads.
123 </p>
124 <p/>
125 <b>This API is experimental and may change in the future.</b>
126 <p>
127<P>
128
129<P>
130<DL>
131<DT><B>Since:</B></DT>
132  <DD>solr 1.3</DD>
133</DL>
134<HR>
135
136<P>
137<!-- ======== NESTED CLASS SUMMARY ======== -->
138
139<A NAME="nested_class_summary"><!-- --></A>
140<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
141<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
142<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
143<B>Nested Class Summary</B></FONT></TH>
144</TR>
145<TR BGCOLOR="white" CLASS="TableRowColor">
146<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
147<CODE>static&nbsp;interface</CODE></FONT></TD>
148<TD><CODE><B><A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.Handler.html" title="interface in org.apache.solr.handler.dataimport">XPathRecordReader.Handler</A></B></CODE>
149
150<BR>
151&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Implement this interface to stream records as and when one is found.</TD>
152</TR>
153</TABLE>
154&nbsp;<!-- =========== FIELD SUMMARY =========== -->
155
156<A NAME="field_summary"><!-- --></A>
157<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
158<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
159<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
160<B>Field Summary</B></FONT></TH>
161</TR>
162<TR BGCOLOR="white" CLASS="TableRowColor">
163<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
164<CODE>static&nbsp;int</CODE></FONT></TD>
165<TD><CODE><B><A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.html#FLATTEN">FLATTEN</A></B></CODE>
166
167<BR>
168&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The FLATTEN flag indicates that all text and cdata under a specific
169 tag should be recursivly fetched and appended to the current Node's
170 value.</TD>
171</TR>
172</TABLE>
173&nbsp;
174<!-- ======== CONSTRUCTOR SUMMARY ======== -->
175
176<A NAME="constructor_summary"><!-- --></A>
177<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
178<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
179<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
180<B>Constructor Summary</B></FONT></TH>
181</TR>
182<TR BGCOLOR="white" CLASS="TableRowColor">
183<TD><CODE><B><A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.html#XPathRecordReader(java.lang.String)">XPathRecordReader</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;forEachXpath)</CODE>
184
185<BR>
186&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A constructor called with a '|' seperated list of Xpath expressions
187 which define sub sections of the XML stream that are to be emitted as
188 seperate records.</TD>
189</TR>
190</TABLE>
191&nbsp;
192<!-- ========== METHOD SUMMARY =========== -->
193
194<A NAME="method_summary"><!-- --></A>
195<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
196<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
197<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
198<B>Method Summary</B></FONT></TH>
199</TR>
200<TR BGCOLOR="white" CLASS="TableRowColor">
201<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
202<CODE>&nbsp;<A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.html" title="class in org.apache.solr.handler.dataimport">XPathRecordReader</A></CODE></FONT></TD>
203<TD><CODE><B><A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.html#addField(java.lang.String, java.lang.String, boolean)">addField</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name,
204         <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;xpath,
205         boolean&nbsp;multiValued)</CODE>
206
207<BR>
208&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A wrapper around <code>addField0</code> to create a series of 
209 Nodes based on the supplied Xpath and a given fieldName.</TD>
210</TR>
211<TR BGCOLOR="white" CLASS="TableRowColor">
212<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
213<CODE>&nbsp;<A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.html" title="class in org.apache.solr.handler.dataimport">XPathRecordReader</A></CODE></FONT></TD>
214<TD><CODE><B><A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.html#addField(java.lang.String, java.lang.String, boolean, int)">addField</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name,
215         <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;xpath,
216         boolean&nbsp;multiValued,
217         int&nbsp;flags)</CODE>
218
219<BR>
220&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A wrapper around <code>addField0</code> to create a series of 
221 Nodes based on the supplied Xpath and a given fieldName.</TD>
222</TR>
223<TR BGCOLOR="white" CLASS="TableRowColor">
224<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
225<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;&gt;</CODE></FONT></TD>
226<TD><CODE><B><A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.html#getAllRecords(java.io.Reader)">getAllRecords</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A>&nbsp;r)</CODE>
227
228<BR>
229&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Uses <A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.html#streamRecords(java.io.Reader, org.apache.solr.handler.dataimport.XPathRecordReader.Handler)"><CODE>streamRecords</CODE></A> to parse the XML source but with
230 a handler that collects all the emitted records into a single List which
231 is returned upon completion.</TD>
232</TR>
233<TR BGCOLOR="white" CLASS="TableRowColor">
234<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
235<CODE>&nbsp;void</CODE></FONT></TD>
236<TD><CODE><B><A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.html#streamRecords(java.io.Reader, org.apache.solr.handler.dataimport.XPathRecordReader.Handler)">streamRecords</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A>&nbsp;r,
237              <A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.Handler.html" title="interface in org.apache.solr.handler.dataimport">XPathRecordReader.Handler</A>&nbsp;handler)</CODE>
238
239<BR>
240&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an XML stream reader on top of whatever reader has been
241 configured.</TD>
242</TR>
243</TABLE>
244&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
245<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
246<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
247<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
248</TR>
249<TR BGCOLOR="white" CLASS="TableRowColor">
250<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
251</TR>
252</TABLE>
253&nbsp;
254<P>
255
256<!-- ============ FIELD DETAIL =========== -->
257
258<A NAME="field_detail"><!-- --></A>
259<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
260<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
261<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
262<B>Field Detail</B></FONT></TH>
263</TR>
264</TABLE>
265
266<A NAME="FLATTEN"><!-- --></A><H3>
267FLATTEN</H3>
268<PRE>
269public static final int <B>FLATTEN</B></PRE>
270<DL>
271<DD>The FLATTEN flag indicates that all text and cdata under a specific
272 tag should be recursivly fetched and appended to the current Node's
273 value.
274<P>
275<DL>
276<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.solr.handler.dataimport.XPathRecordReader.FLATTEN">Constant Field Values</A></DL>
277</DL>
278
279<!-- ========= CONSTRUCTOR DETAIL ======== -->
280
281<A NAME="constructor_detail"><!-- --></A>
282<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
283<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
284<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
285<B>Constructor Detail</B></FONT></TH>
286</TR>
287</TABLE>
288
289<A NAME="XPathRecordReader(java.lang.String)"><!-- --></A><H3>
290XPathRecordReader</H3>
291<PRE>
292public <B>XPathRecordReader</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;forEachXpath)</PRE>
293<DL>
294<DD>A constructor called with a '|' seperated list of Xpath expressions
295 which define sub sections of the XML stream that are to be emitted as
296 seperate records.
297<P>
298<DL>
299<DT><B>Parameters:</B><DD><CODE>forEachXpath</CODE> - The XPATH for which a record is emitted. Once the
300 xpath tag is encountered, the Node.parse method starts collecting wanted
301 fields and at the close of the tag, a record is emitted containing all
302 fields collected since the tag start. Once
303 emitted the collected fields are cleared. Any fields collected in the
304 parent tag or above will also be included in the record, but these are
305 not cleared after emitting the record.
306
307 It uses the ' | ' syntax of XPATH to pass in multiple xpaths.</DL>
308</DL>
309
310<!-- ============ METHOD DETAIL ========== -->
311
312<A NAME="method_detail"><!-- --></A>
313<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
314<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
315<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
316<B>Method Detail</B></FONT></TH>
317</TR>
318</TABLE>
319
320<A NAME="addField(java.lang.String, java.lang.String, boolean)"><!-- --></A><H3>
321addField</H3>
322<PRE>
323public <A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.html" title="class in org.apache.solr.handler.dataimport">XPathRecordReader</A> <B>addField</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name,
324                                  <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;xpath,
325                                  boolean&nbsp;multiValued)</PRE>
326<DL>
327<DD>A wrapper around <code>addField0</code> to create a series of 
328 Nodes based on the supplied Xpath and a given fieldName. The created 
329 nodes are inserted into a Node tree.
330<P>
331<DD><DL>
332<DT><B>Parameters:</B><DD><CODE>name</CODE> - The name for this field in the emitted record<DD><CODE>xpath</CODE> - The xpath expression for this field<DD><CODE>multiValued</CODE> - If 'true' then the emitted record will have values in
333                    a List<String></DL>
334</DD>
335</DL>
336<HR>
337
338<A NAME="addField(java.lang.String, java.lang.String, boolean, int)"><!-- --></A><H3>
339addField</H3>
340<PRE>
341public <A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.html" title="class in org.apache.solr.handler.dataimport">XPathRecordReader</A> <B>addField</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name,
342                                  <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;xpath,
343                                  boolean&nbsp;multiValued,
344                                  int&nbsp;flags)</PRE>
345<DL>
346<DD>A wrapper around <code>addField0</code> to create a series of 
347 Nodes based on the supplied Xpath and a given fieldName. The created 
348 nodes are inserted into a Node tree.
349<P>
350<DD><DL>
351<DT><B>Parameters:</B><DD><CODE>name</CODE> - The name for this field in the emitted record<DD><CODE>xpath</CODE> - The xpath expression for this field<DD><CODE>multiValued</CODE> - If 'true' then the emitted record will have values in
352                    a List<String><DD><CODE>flags</CODE> - FLATTEN: Recursivly combine text from all child XML elements</DL>
353</DD>
354</DL>
355<HR>
356
357<A NAME="getAllRecords(java.io.Reader)"><!-- --></A><H3>
358getAllRecords</H3>
359<PRE>
360public <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;&gt; <B>getAllRecords</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A>&nbsp;r)</PRE>
361<DL>
362<DD>Uses <A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.html#streamRecords(java.io.Reader, org.apache.solr.handler.dataimport.XPathRecordReader.Handler)"><CODE>streamRecords</CODE></A> to parse the XML source but with
363 a handler that collects all the emitted records into a single List which
364 is returned upon completion.
365<P>
366<DD><DL>
367<DT><B>Parameters:</B><DD><CODE>r</CODE> - the stream reader
368<DT><B>Returns:</B><DD>results a List of emitted records</DL>
369</DD>
370</DL>
371<HR>
372
373<A NAME="streamRecords(java.io.Reader, org.apache.solr.handler.dataimport.XPathRecordReader.Handler)"><!-- --></A><H3>
374streamRecords</H3>
375<PRE>
376public void <B>streamRecords</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A>&nbsp;r,
377                          <A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.Handler.html" title="interface in org.apache.solr.handler.dataimport">XPathRecordReader.Handler</A>&nbsp;handler)</PRE>
378<DL>
379<DD>Creates an XML stream reader on top of whatever reader has been
380 configured. Then calls parse() with a handler which is
381 invoked forEach record emitted.
382<P>
383<DD><DL>
384<DT><B>Parameters:</B><DD><CODE>r</CODE> - the stream reader<DD><CODE>handler</CODE> - The callback instance</DL>
385</DD>
386</DL>
387<!-- ========= END OF CLASS DATA ========= -->
388<HR>
389
390
391<!-- ======= START OF BOTTOM NAVBAR ====== -->
392<A NAME="navbar_bottom"><!-- --></A>
393<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
394<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
395<TR>
396<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
397<A NAME="navbar_bottom_firstrow"><!-- --></A>
398<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
399  <TR ALIGN="center" VALIGN="top">
400  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
401  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
402  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
403  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/XPathRecordReader.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
404  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
405  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
406  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
407  </TR>
408</TABLE>
409</TD>
410<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
411</EM>
412</TD>
413</TR>
414
415<TR>
416<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
417&nbsp;<A HREF="../../../../../org/apache/solr/handler/dataimport/XPathEntityProcessor.html" title="class in org.apache.solr.handler.dataimport"><B>PREV CLASS</B></A>&nbsp;
418&nbsp;<A HREF="../../../../../org/apache/solr/handler/dataimport/XPathRecordReader.Handler.html" title="interface in org.apache.solr.handler.dataimport"><B>NEXT CLASS</B></A></FONT></TD>
419<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
420  <A HREF="../../../../../index.html?org/apache/solr/handler/dataimport/XPathRecordReader.html" target="_top"><B>FRAMES</B></A>  &nbsp;
421&nbsp;<A HREF="XPathRecordReader.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
422&nbsp;<SCRIPT type="text/javascript">
423  <!--
424  if(window==top) {
425    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
426  }
427  //-->
428</SCRIPT>
429<NOSCRIPT>
430  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
431</NOSCRIPT>
432
433
434</FONT></TD>
435</TR>
436<TR>
437<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
438  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
439<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
440DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
441</TR>
442</TABLE>
443<A NAME="skip-navbar_bottom"></A>
444<!-- ======== END OF BOTTOM NAVBAR ======= -->
445
446<HR>
447
448          <address>Copyright &copy; 2000-2012 Apache Software Foundation.  All Rights Reserved.</address>
449          <script src='../../../../../prettify.js' type='text/javascript'></script>
450          <script type='text/javascript'>
451            (function(){
452              var oldonload = window.onload;
453              if (typeof oldonload != 'function') {
454                window.onload = prettyPrint;
455              } else {
456                window.onload = function() {
457                  oldonload();
458                  prettyPrint();
459                }
460              }
461            })();
462          </script>
463       
464</BODY>
465</HTML>
Note: See TracBrowser for help on using the repository browser.