Inline... On Feb 5, 2011, at 4:28 AM, Ryan Chan wrote:
> Hello all, > > I am following this tutorial: > http://lucene.apache.org/solr/tutorial.html, I am playing with the > TermVector, here is my step: > > > 1. Launch the example server, java -jar start.jar > > 2. Index the monitor.xml, java -jar post.jar monitor.xml, which > contains the following > > <add><doc> > <field name="id">3007WFP</field> > <field name="name">Dell Widescreen UltraSharp 3007WFP</field> > <field name="manu">Dell, Inc.</field> > <field name="cat">electronics</field> > <field name="cat">monitor</field> > <field name="features">30" TFT active matrix LCD, 2560 x 1600, .25mm > dot pitch, 700:1 contrast</field> > <field name="includes">USB cable</field> > <field name="weight">401.6</field> > <field name="price">2199</field> > <field name="popularity">6</field> > <field name="inStock">true</field> > </doc></add> > > > 3. Execute the query to search for "25", as you can see, there are two > `25` in the field features, i.e. > http://localhost/solr/select/?q=25&version=2.2&start=0&rows=10&indent=on&qt=tvrh&tv.all=true > > 4. The term vector in the result does not make sense to me > > > <lst name="termVectors"> > - > <lst name="doc-2"> > <str name="uniqueKey">3007WFP</str> > - > <lst name="includes"> > - > <lst name="cabl"> > <int name="tf">1</int> > - > <lst name="offsets"> > <int name="start">4</int> > <int name="end">9</int> > </lst> > - > <lst name="positions"> > <int name="position">1</int> > </lst> > <int name="df">1</int> > <double name="tf-idf">1.0</double> > </lst> > - > <lst name="usb"> > <int name="tf">1</int> > - > <lst name="offsets"> > <int name="start">0</int> > <int name="end">3</int> > </lst> > - > <lst name="positions"> > <int name="position">0</int> > </lst> > <int name="df">1</int> > <double name="tf-idf">1.0</double> > </lst> > </lst> > </lst> > <str name="uniqueKeyFieldName">id</str> > </lst> > > What I want to know is the relative position the keywords within a field. > > Anyone can explain the above result to me? It's a little hard to read due to the indentation, but AFAICT you have two terms, usb and "cabl". USB appears at position 0 and cabl at position 1. Those are the relative positions to each other. Perhaps you can explain a bit more what you are trying to do? -------------------------- Grant Ingersoll http://www.lucidimagination.com/ Search the Lucene ecosystem docs using Solr/Lucene: http://www.lucidimagination.com/search