Need help in filtering records based on radius value in solr

2010-05-04 Thread KshamaPai

Hi,
I am using solr with  Lucene spatial 2.9.1 as per
http://www.ibm.com/developerworks/java/library/j-spatial/ 

I want to write a query, that will retrieve records within a given radius 
using hsin function, and using cartesian tiers as filters. So i wrote query
like this
 
http://localhost:8983/solr/select/?q=body:engineering colleges^0 AND
_val_:recip(hsin(0.227486,1.354193 , lat_rad, lng_rad, 4), 1, 1, 0)^100
fq={!tier x=13.033993 y=77.589569 radians=false dist=4 prefix=tier_
unit=m}

But the records retrieved are not varying even if i change the radius . So
can any one tell me if anything is wrong with the query or is there any
configuration issues related to solr in order to make this work

Thanks in advance.  
-- 
View this message in context: 
http://lucene.472066.n3.nabble.com/Need-help-in-filtering-records-based-on-radius-value-in-solr-tp775644p775644.html
Sent from the Solr - User mailing list archive at Nabble.com.


problem during benchmarking solr query

2010-03-16 Thread KshamaPai

Hi,
Am using autobench to benchmark solr with the query
http://localhost:8983/solr/select/?q=body:hotel AND
_val_:recip(hsin(0.7113258,-1.291311553,lat_rad,lng_rad,30),1,1,0)^100

But if i specify the same in the autobench command as
autobench --file bar1.tsv --high_rate 100 --low_rate 20 --rate_step 20
--host1 localhost --single_host --port1 8983 --num_conn 10 --num_call 10
--uri1 /solr/select/?q=body:hotel AND  
_val_:recip(hsin(0.7113258,-1.291311553,lat_rad,lng_rad,30),1,1,0)^100

it is taking body:hotel as uri but not _val_ part ,which i think is because
of the space after hotel. Even if i try  escaping  this in autobench using
'\' it ll give parse error in solr.

Can any one suggest me how do i handle this?so that entire query is
considered as uri  and also solr respond with appropriate reply.
thank you.
 

-- 
View this message in context: 
http://old.nabble.com/problem-during-benchmarking-solr-query-tp27926801p27926801.html
Sent from the Solr - User mailing list archive at Nabble.com.



Re: which links do i have to follow to understand location based search concepts?

2010-03-08 Thread KshamaPai
)
 [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.



Re: which links do i have to follow to understand location based search concepts?

2010-03-08 Thread KshamaPai

Hi,
During indexing its taking localhost and port 8983, 
index: 
 [echo] Indexing ./data/ 
 [java] ./data/   http://localhost:8983/solr

So other case where in solr instance not running ,what may be the reason
that solr is not running? (Am new to solr)

You mean it has to do nothing with the xml since its giving

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:79)
 [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)


and line 79 in driver.java is 
 numIndexed+=02s.process(new FileInputstream(file)); //where its taking my
xml file.




Shalin Shekhar Mangar wrote:
 
 On Mon, Mar 8, 2010 at 6:21 PM, KshamaPai kshamapai2...@gmail.com wrote:
 

 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.756015 lng=-73.984773 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

 
 The Connection refused message suggests that your Solr instance is
 either
 not running or you have given the wrong host/port in your driver.
 
 -- 
 Regards,
 Shalin Shekhar Mangar.
 
 

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



which links do i have to follow to understand location based search concepts?

2010-03-07 Thread KshamaPai

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?

Can any one suggest me any link that will help me understand all these
concepts better.

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



Need suggestion regarding custom transformer

2010-03-02 Thread KshamaPai

Hi,
Am new to solr.
I am trying location aware search with spatial lucene in solr1.5 nightly
build.
My table in mysql has just lat,lng and some text .I want to add geohash,
lat_rad(lat in radian) and lng_rad field into the document before indexing.
I have used dataimport to get my table to solr.
I have to use GeohashUtils.Encode() to get geohash from corresponding
lat,lng of each row;
and *ToRads function to get lat in radians.

Can i use custom transformers so that after retreiving each row , add these
fields and then index while using dataimport?
Or do i have to do data migration to xml and then do changes required before
indexing?

Thanks in advance.



-- 
View this message in context: 
http://old.nabble.com/Need-suggestion-regarding-custom-transformer-tp27763576p27763576.html
Sent from the Solr - User mailing list archive at Nabble.com.