Sorry, I'm on a restricted machine so can't get the precise URL. But, there's a debug page for DIH that might allow you to see what the query actually returns. I'd guess one of two things: 1> you aren't getting the number of rows you think. 2> you aren't committing the documents you add.
But that's just a guess. Best Erick On Aug 3, 2011 2:15 PM, "anand sridhar" <anand.for...@gmail.com> wrote: > Hi, > I am a newbie to Solr and have been trying to learn using > DataImportHandler. > I have a query in data-config.xml that fetches about 5 records when i fire > it in SQL Query manager. > However, when Solr does a full import, it is skipping 4 records and only > importing 1 record. > What could be the reason for that. ? > > My data-config.xml looks like this - > > <dataConfig> > <dataSource type="JdbcDataSource" > name="GeoService" > driver="net.sourceforge.jtds.jdbc.Driver" > url="jdbc:jtds:sqlserver://10.168.50.104/ZipCodeLookup" > user="sa" > password="psiuser"/> > <document> > <entity name="city" > query="select ll.cityId as id, ll.zip as zipCode, c.cityName as > cityName, st.stateName as state, ct.countryName as country from latlonginfo > ll,city c, state st, country ct where ll.cityId = c.cityID and > c.stateID=st.stateID and st.countryID = ct.countryID > order by ll.areacode" > dataSource="GeoService"> > <field column="zipCode" name="zipCode"/> > <field column="cityName" name="cityName"/> > <field column="state" name="state"/> > <field column="country" name="country"/> > </entity> > </document> > </dataConfig> > > My fields definition in schema.xml looks as below - > > <field name="CityName" type="text_general" indexed="true" stored="true" /> > <field name="zipCode" type="text_general" indexed="true" stored="true"/> > <field name="state" type="text_general" indexed="true" stored="true" /> > <field name="country" type="text_general" indexed="true" stored="true" /> > > One observation I made was the 1 record that is being indexes is the last > record in the result set. I have verified that there are no duplicate > records being retreived. > > For eg, if the result set from Database is - > > zipcode CityName state country > ------- --------- ----- ------- > 91324 Northridge CA USA > 91325 Northridge CA USA > 91327 Northridge CA USA > 91328 Northridge CA USA > 91329 Northridge CA USA > 91330 Northridge CA USA > > The record being indexed is the last record all the time. > > Any suggestions are welcome. > > Thanks, > Anand