Should be something like:
<add>
<doc>
  <field name="id">1125258</field>
  <field name="areaname">Mumgaon</field>
  <field name="geo">26.3833,93.4833</field>
</doc>

<doc>
  <field name="id">1125259</field>
  <field name="areaname">Mummasar</field>
  <field name="geo">28.2167,74.2833</field>
</doc>

</add>

Then just post it to Solr with post.jar. for testing, just to make
things simple, I put the XML file in example/exampledocs/eoe.xml and
issued the following from that directory.

java -Durl=http://localhost:8983/solr/techproducts/update -jar post.jar eoe.xml

But let me emphasize that it should _not_ be necessary to use the XML
form, the CSV should work if it's set up correctly and be faster.
Furthermore, the post.jar tool isn't always the best choice for
production. I just used these since they were easy for testing on a
stock Solr. If you get it working with the XML import, then you can be
confident that your field definitions are OK etc.  focus on getting
the CSV import to behave....

Best,
Erick


On Wed, Sep 28, 2016 at 10:55 AM, Zoomash Team <i...@zoomash.co.uk> wrote:
> Hi,
>
> Thanks for your reply.
>
> What format should xml file be for data import?
>
> Will something like below be acceptable to my field definition?
>
> <?xml version="1.0" encoding="utf-8" ?>
> <location>
>   <id>1</id>
>   <areaname>Test</areaname>
>   <geo>123,456</geo>
> </location>
>
> <location>
>   <id>2</id>
>   <areaname>Test2</areaname>
>   <geo>78,89</geo>
> </location>
>
>
> Thanks
>
> AA
>
>
> On 28 September 2016 at 18:38, Erick Erickson <erickerick...@gmail.com>
> wrote:
>
>> First, nice job of posting enough information to define the problem and
>> allow
>> us to check something! Far too often it takes 3 back-and-forths to get
>> enough
>> info to say anything.
>>
>> Hmm, on the surface that looks OK. I tried using your field
>> definitions, data and query
>> and it works fine on my machine on 6.2.1.
>>
>> I used this query:
>>
>> http://localhost:8983/solr/techproducts/query?q={!
>> geofilt%20sfield=geo}&pt=28.2167,74.2833&d=100
>>
>> I'm assuming you left off the "q=" bits just for brevity. If I don't
>> put that in I get zero docs...
>>
>> So that makes me wonder if your import is somehow not doing what you
>> expect. Rather
>> than use CSV, I copy/pasted into an XML doc and posted that since it
>> was faster....
>>
>> Try going into the admin UI>>(core)>>schema and picking one of the geo
>> fields
>> (geo_0_coordinate or geo_1_coordinate) You should see some stuff that
>> "makes sense"
>> although there'll also be some extra stuff due to it being a tdouble.
>> This is to check
>> that the import is happening correctly.
>>
>> And if none of that makes sense, could you paste the results of adding
>> &debug=query
>> to the URL?
>>
>>
>> Best,
>> Erick
>>

Reply via email to