Google AppEngine Search API distance search, accuracy is not correct - google-app-engine

I have a strange accuracy problem using Google AppEngine Search API and doing distance searches.
when running this query:
distance(pos, geopoint(55.7, 13.4)) < 2000
I get these two documents back:
ScoredDocument(documentId=5649050225344512_DistanceSearch_1391166416282, fields=Field(name=pos, value=GeoPoint(latitude=55.709999, longitude=13.410000), type=GEO_POINT)], rank=97326421, scores=[-1697.2195690708354])
ScoredDocument(documentId=6270652252160000_DistanceSearch_1391166416282, fields= Field(name=pos, value=GeoPoint(latitude=55.715000, longitude=13.419000), type=GEO_POINT)], rank=97326418, scores=[0.0])
If we look at the real distances from 55.7, 13.4 to the documents locations, I measure them to be
55.709999, 13.41000 to 55.7, 13.4 = 1276 meters
55.715000, 13.419000 to 55.7, 13.3 = 2049 meters
In my query I stated < 2000 meters, expecting only one answer (the 1276 meters) but I got both.
The strange thing is if I lower the distance search to 717 meter I still get both. If i then lower it to 716 meters or less, I get no answers.
What am I doing wrong? I'm running this on a production app engine instance v1.8.8, not devserver.

Related

how is tf calcualted?

I want to know how is the term frequency factor i.e. tf calculated ?
I want to know the tf of the content. The results for the following query :
curl -g 'http://localhost:8983/solr/nutch/select?indent=on&q=python&wt=json&fl=title,score,[features%20efi.query=python%20store=myfeature_store]',content
is:
...
{
"title":"Raspberry Pi Stack Exchange",
"content":"Raspberry Pi Stack Exchange\nStack Exchange Network\nStack Exchange network consists of 175 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.\nVisit Stack Exchange\nLoading…\n0\n+0\nTour Start here for a quick overview of the site\nHelp Center Detailed answers to any questions you might have\nMeta Discuss the workings and policies of this site\nAbout Us Learn more about Stack Overflow the company\nBusiness Learn more about hiring developers or posting ads with us\nLog in\nSign up\ncurrent community\nRaspberry Pi\nhelp\nchat\nRaspberry Pi Meta\nyour communities\nSign up or log in to customize your list.\nmore stack exchange communities\ncompany blog\nBy using our site, you acknowledge that you have read and understand our Cookie Policy , Privacy Policy , and our Terms of Service .\nRaspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.\nSign up to join this community\nAnybody can ask a question\nAnybody can answer\nThe best answers are voted up and rise to the top\nHome\nQuestions\nTags\nUsers\nUnanswered\nExplore our Questions\nAsk Question\nraspbian pi-3 gpio python networking wifi pi-2 usb boot ssh\nmore tags\nActive\nHot\nWeek\nMonth\n0\nvotes\n0\nanswers\n3\nviews\nHostname on router and pi do not match\nheadless\nasked 4 mins ago\nJoseph\n1\n2\nvotes\n0\nanswers\n49\nviews\nAndroid won't connect to RasPi access point\nandroid\naccess-point\nsystemd-networkd\nwpa-supplicant\nmodified 6 mins ago\nThePunisher\n121\n2\nvotes\n3\nanswers\n53\nviews\napt-get update errors after copying Raspbian to new SD card\nraspbian\napt\nmodified 17 mins ago\nifschleife\n121\n1\nvote\n5\nanswers\n444\nviews\nWifi cuts out after a few hours, have to restart Pi\nraspbian\nnetworking\nwifi\nssh\nminecraft\nmodified 53 mins ago\nCommunity ♦\n1\n2\nvotes\n2\nanswers\n369\nviews\nCan't SSH by name on stretch; can on jessie\nssh\nraspbian-stretch\nputty\nmodified 1 hour ago\nCommunity ♦\n1\n0\nvotes\n0\nanswers\n8\nviews\nHow to use only 3 GPIO pins for a JSN-SR04T waterproof ultrasonic sensor\ngpio\nsensor\nasked 2 hours ago\nPeter bill\n191\n1\nvote\n2\nanswers\n52\nviews\nGPIO Not changing its value in a particular code section\ngpio\npython\nrelay\nmodified 2 hours ago\ntlfong01\n2,465\n0\nvotes\n0\nanswers\n1\nview\nMakes OpenVPN a local Apache Webserver accessable from outside?\nweb-server\nvpn\napache-httpd\nweb-browsers\nweb\nasked 2 hours ago\nJakob\n113\n0\nvotes\n1\nanswer\n15\nviews\nsainsmart relay - switches on when pi shuts down\npi-3\nboot-issues\nanswered 2 hours ago\npir8ped\n79\n0\nvotes\n1\nanswer\n301\nviews\nRaspberry Pi Matchbox virtual keyboard missing colon\ndisplay\nmodified 2 hours ago\nCommunity ♦\n1\n-1\nvotes\n0\nanswers\n27\nviews\nHow to fix ssh connection that's been broken by dhcpcd service\nlinux\nnetworking\nssh\ndhcp\nmodified 3 hours ago\nBelserich\n1\n4\nvotes\n2\nanswers\n8k\nviews\nHow can I use OpenCV with Python 3 on a Raspberry Pi?\nopencv\npython-3\nanswered 3 hours ago\nIngo\n19.1k\n2\nvotes\n0\nanswers\n14\nviews\nRPi-Zero, HID keyboard gadget for BIOS keyboard\nusb\nkeyboard\nhid\nlibcomposite\nmodified 3 hours ago\nEphemeral\n1,561\n0\nvotes\n0\nanswers\n13\nviews\nHow do I go about auto-mounting my NTFS hard drive at boot?\nboot\nmount\nfstab\nntfs\nasked 3 hours ago\nHasake\n11\nBrowse more Questions\nHot Network Questions\nTriple Approx Symbol\nBest ways to invest for a planned house purchase in 1 year?\nVariable selection in logistic regression model\nShould rooms be designed to minimize waste of sheet goods?\nWhy is Perihelion and Shortest day in North Hemisphere different?\nHow can I estimate the speed of this code section for this microcontroller?\nShell - Navigate up 'n' directories\nLooking for an effective pattern to cope with switch statements in C#\n",
"score":0.00982895,
"[features]":"tf=2.0"},
...
How is the value 2.0 coming? The word python is coming 4 times and there are 330 words in the content.
Solr now uses the BM25 scorer and not TF/IDF directly. The tf value used in BM25 is not the exact count of the times the term occur, but uses sqrt(TF).
sqrt(4) == 2.0
Raw TF TF Score
1 1.0
2 1.141
4 2.0
8 2.828
16 4.0

Cloud Vision billing/pricing inconsistency

I was just glossing over my billing history and to my surprise found out I've been charged $28.71 for Cloud Vision API Cloud Vision API Label Detection Operations. I'm really confused because it says I have "5356 counts".
The Cloud Vision pricing table lists 1001-1000000 units as $5.00 for Label Detection.
Is this a mistake on Google's billing or am I interpretting the pricing incorrectly? I've read over the description several times and am not sure how I could be misunderstanding the breakdown.
Price per 1000 units
If the count includes free quota then you have 4356 units. If the units are rounded up to 5000, then you have 5 units x $5 = 25 (+ tax?)
Pricing Chart
npe's answer is accurate. Adding more details that I have.
Had the same issue. I mailed the sales team and the
https://cloud.google.com/vision/
The tag they added to resolve any such confusions is : "Price per 1,000 units, by monthly usage"
Thanks
Suman

echoprint server - Finger print search time taking 2-3 seconds

We are facing high fingerprint match solr query time. Following is our setup Info:
echonest/echoprint-server running on single node (solr 1.0) running on amazon ec2 instance m3.2x large box with 30G RAM
& 8 cores
2.5 million tracks(segment count 19933333) ingested with solr 1.0 index size around 91G.
Applied optimization HashQueryComponent.java https://github.com/playax/echoprint-server/commit/706d26362bbe9141203b2b6e7846684e7a417616#diff-f9e19e870c128c0d64915f304cf43677
Also tried to capture stats of eval method, some of the loop iterations of sequential subreader of index reader took more than 1 second to iterate over all the terms.
Any suggestions or pointers in the right directions will be very helpful.

Google Custom Search JSON API quota and billing

I'm just deciding between GSS (Google Site Search) and CSE (Custom Search Engine) with JSON API. But I'm a little bit confused about JSON API billing.
My approved start budget is 100$ per year which allows 20 000 queries/year in GSS but how many queries will I get in JSON API and how I must set quota to not exceed the budget?
I have opinion how google makes billing:
Price of 1 query is 0.005$ = 5$ / 1000 queries => https://developers.google.com/custom-search/json-api/v1/overview#pricing
Google adds day queries (over 100 free) and then create billing for month. So my quota has to be set to 154 (100 free + 54):
54 queries per day * 31 days * 12 months = 20 088 queries * 0.005$ = 100,44$ which is maximum I will pay (lesser maybe).
Am I right? Or google makes billing in different way?

How to store mathematical expressions/explanations into database

I am given a task to develop a website for maths students with questions and their explanations.The site will have around 20,000 questions.And I need an effective way(easy storage,faster querying and fast rendering) to store those questions into the database.
Sample Question
In the first 10 overs of a cricket game, the run rate was only 3.2. What should be the run rate in the remaining 40 overs to reach the target of 282 runs?
Required run rate = 282 - (3.2 x 10) = 250 = 6.25
---------------- -----
40 40
Questions is a simple string and can easily be stored.But the real problem is to store those expressions with brackets and divide into the database?
You could store the expressions in LaTeX in the database.
Edit:
You can use libraries like http://www.mathjax.org/ for client-side rendering of the equations.
You have several options to store a string representation of mathematical expressions: MathML, LaTeX or ASCIIMathML.
For displaying it in a web browser I recommend MathJax.

Resources