Hi,
Thank You for explaining it in a simple way.
The article really helped me to understand the concepts better.

My question is ,Is it necessary that the data what you are indexing in
spatial example, is to be in the osm format and using facts files?
 In my case,am trying to index data ,that has just lat,longitude and related
news item(just text) in a xml file which looks like this

<?xml version="1.0" encoding="UTF-8"?>
<data name="finals">
        <row id="1" lat="40.7560150000" lng="-73.9847730000" body="some text
data(may be very large data)">
</row>
</data>

I have silghtly modified driver.java and other .java files in src/main/java
folder, so that these fields are considered for indexing.(but have retained
geohash,lat_rad,lng_rad as done in spatial example)

But when i do ant index , am getting 

Buildfile: build.xml

init:

compile:

index:
     [echo] Indexing ./data/ 
     [java] ./data/   http://localhost:8983/solr
     [java] Num args: 2
     [java] Starting indexing
     [java] Indexing: ./data/final.xml
     [java] Mar 8, 2010 4:40:35 AM
org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
     [java] INFO: I/O exception (java.net.ConnectException) caught when
processing request: Connection refused
     [java] Mar 8, 2010 4:40:35 AM
org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
     [java] INFO: Retrying request
     [java] Mar 8, 2010 4:40:35 AM
org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
     [java] INFO: I/O exception (java.net.ConnectException) caught when
processing request: Connection refused
     [java] Mar 8, 2010 4:40:35 AM
org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
     [java] INFO: Retrying request
     [java] Mar 8, 2010 4:40:35 AM
org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
     [java] INFO: I/O exception (java.net.ConnectException) caught when
processing request: Connection refused
     [java] Mar 8, 2010 4:40:35 AM
org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
     [java] INFO: Retrying request
     [java] org.apache.solr.client.solrj.SolrServerException:
java.net.ConnectException: Connection refused
     [java]     at
org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:472)
     [java]     at
org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:243)
     [java]     at
org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:105)
     [java]     at
org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:49)
     [java]     at OSMHandler.endElement(OSMHandler.java:127)
     [java]     at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
     [java]     at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)
     [java]     at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
     [java]     at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
     [java]     at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
     [java]     at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
     [java]     at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
     [java]     at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
     [java]     at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
     [java]     at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
     [java]     at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
     [java]     at javax.xml.parsers.SAXParser.parse(SAXParser.java:198)
     [java]     at OSM2Solr.process(OSM2Solr.java:44)
     [java]     at Driver.main(Driver.java:80)
     [java] Caused by: java.net.ConnectException: Connection refused
     [java]     at java.net.PlainSocketImpl.socketConnect(Native Method)
     [java]     at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
     [java]     at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
     [java]     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
     [java]     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
     [java]     at java.net.Socket.connect(Socket.java:519)
     [java]     at java.net.Socket.connect(Socket.java:469)
     [java]     at java.net.Socket.<init>(Socket.java:366)
     [java]     at java.net.Socket.<init>(Socket.java:240)
     [java]     at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
     [java]     at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
     [java]     at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
     [java]     at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
     [java]     at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
     [java]     at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
     [java]     at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
     [java]     at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
     [java]     at
org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:416)
     [java]     ... 18 more
  

Is it because my xml file is not properly structured, do i have to include a
Dtd?

Am not able to figure out.
Please help me.
Thank you.





Grant Ingersoll-6 wrote:
> 
> 
> On Mar 7, 2010, at 7:45 AM, KshamaPai wrote:
> 
>> 
>> Hi,
>> 
>> Inorder to understand - cartessian tiers,how are they contributing in
>> location based search - What is happening internally when we give query
>> to
>> solr like http://localhost:8983/solr/select/?q=name:Minneapolis AND
>> _val_:"recip(hsin(0.78, -1.6, lat_rad, lon_rad, 3963.205), 1, 1, 0)"^100
>> and
>> other functions like ghhsin(),sqedist(),dist() .how is it working to
>> retrieve relevent records?
>> 
> 
> This query says to me:  Find all documents that have the word Minneapolis
> in the name and boost the scores based on not only the term scores (i.e.
> Minneapolis) but also
> add in a boost based on 1 over the haversine distance between the point
> 0.78, -1.6 (in radians) and the values contained in the lat_rad and
> lon_rad fields (for each document that matched Minneapolis) and boost that
> resulting score by 100.  In other words, 1 over the distance.
> 
> The other functions are just different ways of calculating distance. 
> GHSin is the Haversine distance applied to a GeoHash field.  A geohash
> field encodes lat/lon into a single field.  Haversine is generally more
> accurate for measurements on a Sphere.  Dist and sqedist are the
> traditional distances used in a Rectangular Coordinate System (aka the
> stuff you learned about way back when as a kid).  Even Haversine isn't as
> accurate as one could get, since the Earth is not actually a Sphere.  For
> most situations, however, it is more than sufficient.  If you really need
> the utmost accuracy, you could implement Vincenty's formula.  
> 
> 
>> Can any one suggest me any link that will help me understand all these
>> concepts better.
> 
> 
> Here's the Solr wiki page: http://wiki.apache.org/solr/SpatialSearch
> 
> Here's an article I wrote on spatial:
> http://www.ibm.com/developerworks/opensource/library/j-spatial/index.html
> 

-- 
View this message in context: 
http://old.nabble.com/which-links-do-i-have-to-follow-to-understand-location-based-search-concepts--tp27811139p27819862.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to