Ticket #5043: debug_osm_nom.htm

File debug_osm_nom.htm, 16.8 KB (added by emilio.mejia@…, 5 years ago)

Debug for osm server query

Line 
1string(130) "select word_id,word_token, word, class, type, country_code, operator, search_name_count from word where word_token in (' co','co')"
2array(1) {
3  [0]=>
4  array(3) {
5    ["string"]=>
6    string(2) "co"
7    ["words"]=>
8    array(1) {
9      [0]=>
10      string(2) "co"
11    }
12    ["wordsets"]=>
13    array(1) {
14      [0]=>
15      array(1) {
16        [0]=>
17        string(2) "co"
18      }
19    }
20  }
21}
22array(2) {
23  [" co"]=>
24  array(4) {
25    [0]=>
26    array(8) {
27      ["word_id"]=>
28      string(7) "1177659"
29      ["word_token"]=>
30      string(3) " co"
31      ["word"]=>
32      string(2) "co"
33      ["class"]=>
34      NULL
35      ["type"]=>
36      NULL
37      ["country_code"]=>
38      NULL
39      ["operator"]=>
40      NULL
41      ["search_name_count"]=>
42      string(1) "0"
43    }
44    [1]=>
45    array(8) {
46      ["word_id"]=>
47      string(8) "15955527"
48      ["word_token"]=>
49      string(3) " co"
50      ["word"]=>
51      NULL
52      ["class"]=>
53      NULL
54      ["type"]=>
55      NULL
56      ["country_code"]=>
57      string(2) "co"
58      ["operator"]=>
59      NULL
60      ["search_name_count"]=>
61      string(1) "0"
62    }
63    [2]=>
64    array(8) {
65      ["word_id"]=>
66      string(8) "15968966"
67      ["word_token"]=>
68      string(3) " co"
69      ["word"]=>
70      NULL
71      ["class"]=>
72      string(5) "place"
73      ["type"]=>
74      string(6) "county"
75      ["country_code"]=>
76      NULL
77      ["operator"]=>
78      NULL
79      ["search_name_count"]=>
80      string(1) "0"
81    }
82    [3]=>
83    array(8) {
84      ["word_id"]=>
85      string(8) "16008262"
86      ["word_token"]=>
87      string(3) " co"
88      ["word"]=>
89      NULL
90      ["class"]=>
91      string(7) "landuse"
92      ["type"]=>
93      string(5) "grass"
94      ["country_code"]=>
95      NULL
96      ["operator"]=>
97      NULL
98      ["search_name_count"]=>
99      string(1) "0"
100    }
101  }
102  ["co"]=>
103  array(1) {
104    [0]=>
105    array(8) {
106      ["word_id"]=>
107      string(4) "1771"
108      ["word_token"]=>
109      string(2) "co"
110      ["word"]=>
111      NULL
112      ["class"]=>
113      NULL
114      ["type"]=>
115      NULL
116      ["country_code"]=>
117      NULL
118      ["operator"]=>
119      NULL
120      ["search_name_count"]=>
121      string(6) "270352"
122    }
123  }
124}
125array(2) {
126  [1]=>
127  array(2) {
128    [0]=>
129    array(16) {
130      ["iSearchRank"]=>
131      int(1)
132      ["iNamePhrase"]=>
133      int(-1)
134      ["sCountryCode"]=>
135      bool(false)
136      ["aName"]=>
137      array(1) {
138        [1177659]=>
139        string(7) "1177659"
140      }
141      ["aAddress"]=>
142      array(0) {
143      }
144      ["aFullNameAddress"]=>
145      array(0) {
146      }
147      ["aNameNonSearch"]=>
148      array(0) {
149      }
150      ["aAddressNonSearch"]=>
151      array(0) {
152      }
153      ["sOperator"]=>
154      string(0) ""
155      ["aFeatureName"]=>
156      array(0) {
157      }
158      ["sClass"]=>
159      string(0) ""
160      ["sType"]=>
161      string(0) ""
162      ["sHouseNumber"]=>
163      string(0) ""
164      ["fLat"]=>
165      float(10.361465)
166      ["fLon"]=>
167      float(-84.476996666667)
168      ["fRadius"]=>
169      float(0.1)
170    }
171    [1]=>
172    array(16) {
173      ["iSearchRank"]=>
174      int(1)
175      ["iNamePhrase"]=>
176      int(-1)
177      ["sCountryCode"]=>
178      string(2) "co"
179      ["aName"]=>
180      array(0) {
181      }
182      ["aAddress"]=>
183      array(0) {
184      }
185      ["aFullNameAddress"]=>
186      array(0) {
187      }
188      ["aNameNonSearch"]=>
189      array(0) {
190      }
191      ["aAddressNonSearch"]=>
192      array(0) {
193      }
194      ["sOperator"]=>
195      string(0) ""
196      ["aFeatureName"]=>
197      array(0) {
198      }
199      ["sClass"]=>
200      string(0) ""
201      ["sType"]=>
202      string(0) ""
203      ["sHouseNumber"]=>
204      string(0) ""
205      ["fLat"]=>
206      float(10.361465)
207      ["fLon"]=>
208      float(-84.476996666667)
209      ["fRadius"]=>
210      float(0.1)
211    }
212  }
213  [2]=>
214  array(3) {
215    [0]=>
216    array(16) {
217      ["iSearchRank"]=>
218      int(2)
219      ["iNamePhrase"]=>
220      int(-1)
221      ["sCountryCode"]=>
222      bool(false)
223      ["aName"]=>
224      array(0) {
225      }
226      ["aAddress"]=>
227      array(0) {
228      }
229      ["aFullNameAddress"]=>
230      array(0) {
231      }
232      ["aNameNonSearch"]=>
233      array(0) {
234      }
235      ["aAddressNonSearch"]=>
236      array(0) {
237      }
238      ["sOperator"]=>
239      string(4) "near"
240      ["aFeatureName"]=>
241      array(0) {
242      }
243      ["sClass"]=>
244      string(7) "landuse"
245      ["sType"]=>
246      string(5) "grass"
247      ["sHouseNumber"]=>
248      string(0) ""
249      ["fLat"]=>
250      float(10.361465)
251      ["fLon"]=>
252      float(-84.476996666667)
253      ["fRadius"]=>
254      float(0.1)
255    }
256    [1]=>
257    array(16) {
258      ["iSearchRank"]=>
259      int(2)
260      ["iNamePhrase"]=>
261      int(0)
262      ["sCountryCode"]=>
263      bool(false)
264      ["aName"]=>
265      array(0) {
266      }
267      ["aAddress"]=>
268      array(0) {
269      }
270      ["aFullNameAddress"]=>
271      array(0) {
272      }
273      ["aNameNonSearch"]=>
274      array(1) {
275        [1771]=>
276        string(4) "1771"
277      }
278      ["aAddressNonSearch"]=>
279      array(0) {
280      }
281      ["sOperator"]=>
282      string(0) ""
283      ["aFeatureName"]=>
284      array(0) {
285      }
286      ["sClass"]=>
287      string(0) ""
288      ["sType"]=>
289      string(0) ""
290      ["sHouseNumber"]=>
291      string(0) ""
292      ["fLat"]=>
293      float(10.361465)
294      ["fLon"]=>
295      float(-84.476996666667)
296      ["fRadius"]=>
297      float(0.1)
298    }
299    [2]=>
300    array(16) {
301      ["iSearchRank"]=>
302      int(2)
303      ["iNamePhrase"]=>
304      int(-1)
305      ["sCountryCode"]=>
306      bool(false)
307      ["aName"]=>
308      array(0) {
309      }
310      ["aAddress"]=>
311      array(0) {
312      }
313      ["aFullNameAddress"]=>
314      array(0) {
315      }
316      ["aNameNonSearch"]=>
317      array(0) {
318      }
319      ["aAddressNonSearch"]=>
320      array(0) {
321      }
322      ["sOperator"]=>
323      string(4) "near"
324      ["aFeatureName"]=>
325      array(0) {
326      }
327      ["sClass"]=>
328      string(5) "place"
329      ["sType"]=>
330      string(6) "county"
331      ["sHouseNumber"]=>
332      string(0) ""
333      ["fLat"]=>
334      float(10.361465)
335      ["fLon"]=>
336      float(-84.476996666667)
337      ["fRadius"]=>
338      float(0.1)
339    }
340  }
341}
342<table border="1"><tr><th>rank</th><th>Name Tokens</th><th>Name Not</th><th>Address Tokens</th><th>Address Not</th><th>country</th><th>operator</th><th>class</th><th>type</th><th>house#</th><th>Lat</th><th>Lon</th><th>Radius</th></tr><tr><td>1</td><td># co(1177659)#</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>10.361465</td><td>-84.476996666667</td><td>0.1</td></tr><tr><td>1</td><td></td><td></td><td></td><td></td><td>co</td><td></td><td></td><td></td><td></td><td>10.361465</td><td>-84.476996666667</td><td>0.1</td></tr><tr><td>2</td><td></td><td></td><td></td><td></td><td></td><td>near</td><td>landuse</td><td>grass</td><td></td><td>10.361465</td><td>-84.476996666667</td><td>0.1</td></tr><tr><td>2</td><td></td><td>#co(1771)#</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>10.361465</td><td>-84.476996666667</td><td>0.1</td></tr><tr><td>2</td><td></td><td></td><td></td><td></td><td></td><td>near</td><td>place</td><td>county</td><td></td><td>10.361465</td><td>-84.476996666667</td><td>0.1</td></tr></table><hr><b>Search Loop, group 1, loop 1</b><table border="1"><tr><th>rank</th><th>Name Tokens</th><th>Name Not</th><th>Address Tokens</th><th>Address Not</th><th>country</th><th>operator</th><th>class</th><th>type</th><th>house#</th><th>Lat</th><th>Lon</th><th>Radius</th></tr><tr><td>1</td><td># co(1177659)#</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>10.361465</td><td>-84.476996666667</td><td>0.1</td></tr></table>string(442) "select place_id from search_name where name_vector @> ARRAY[1177659] and ST_DWithin(centroid, ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326), 0.1) order by ST_Distance(centroid, ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326)) ASC, ST_Distance(ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326), centroid) asc, (case when importance = 0 OR importance IS NULL then 0.75-(search_rank::float/40) else importance end) DESC limit 2"
343<br><b>Place IDs:</b> array(0) {
344}
345<hr><b>Search Loop, group 1, loop 2</b><table border="1"><tr><th>rank</th><th>Name Tokens</th><th>Name Not</th><th>Address Tokens</th><th>Address Not</th><th>country</th><th>operator</th><th>class</th><th>type</th><th>house#</th><th>Lat</th><th>Lon</th><th>Radius</th></tr><tr><td>1</td><td></td><td></td><td></td><td></td><td>co</td><td></td><td></td><td></td><td></td><td>10.361465</td><td>-84.476996666667</td><td>0.1</td></tr></table>string(432) "select place_id from search_name where country_code = 'co' and ST_DWithin(centroid, ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326), 0.1) order by ST_Distance(centroid, ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326)) ASC, ST_Distance(ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326), centroid) asc, (case when importance = 0 OR importance IS NULL then 0.75-(search_rank::float/40) else importance end) DESC limit 2"
346<br><b>Place IDs:</b> array(0) {
347}
348<hr><b>Search Loop, group 2, loop 3</b><table border="1"><tr><th>rank</th><th>Name Tokens</th><th>Name Not</th><th>Address Tokens</th><th>Address Not</th><th>country</th><th>operator</th><th>class</th><th>type</th><th>house#</th><th>Lat</th><th>Lon</th><th>Radius</th></tr><tr><td>2</td><td></td><td></td><td></td><td></td><td></td><td>near</td><td>landuse</td><td>grass</td><td></td><td>10.361465</td><td>-84.476996666667</td><td>0.1</td></tr></table>string(409) "select place_id from search_name where ST_DWithin(centroid, ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326), 0.1) order by ST_Distance(centroid, ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326)) ASC, ST_Distance(ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326), centroid) asc, (case when importance = 0 OR importance IS NULL then 0.75-(search_rank::float/40) else importance end) DESC limit 50"
349string(521) "select min(rank_search) from placex where place_id in (8326150,5990796115,5990796545,5990796544,3670718864,3670718589,40121621,88567293,89449003,88975223,89359856,88407220,18252874,88240453,88601958,6007392614,18825928,89505177,6007410734,6007410762,88241447,3670718872,59616725,4242317,11218392,11493810,61918120,11124290,61937070,17450953,18036658,18459061,17451990,16813568,17486088,77264143,77264152,16571292,17155507,16561252,77927007,78308055,41061067,78148514,93953687,76899756,76968080,78001707,78148532,19591610)"
350string(534) "select place_id from placex where place_id in (8326150,5990796115,5990796545,5990796544,3670718864,3670718589,40121621,88567293,89449003,88975223,89359856,88407220,18252874,88240453,88601958,6007392614,18825928,89505177,6007410734,6007410762,88241447,3670718872,59616725,4242317,11218392,11493810,61918120,11124290,61937070,17450953,18036658,18459061,17451990,16813568,17486088,77264143,77264152,16571292,17155507,16561252,77927007,78308055,41061067,78148514,93953687,76899756,76968080,78001707,78148532,19591610) and rank_search < 23"
351string(369) "select distinct l.place_id,ST_Distance(ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326), l.centroid) from place_classtype_landuse_grass as l,placex as f where f.place_id in (4242317,3670718864,61937070,61918120,8326150) and ST_DWithin(l.centroid, f.centroid, 0.05) order by ST_Distance(ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326), l.centroid) asc limit 2"
352<br><b>Place IDs:</b> array(0) {
353}
354<hr><b>Search Loop, group 2, loop 4</b><table border="1"><tr><th>rank</th><th>Name Tokens</th><th>Name Not</th><th>Address Tokens</th><th>Address Not</th><th>country</th><th>operator</th><th>class</th><th>type</th><th>house#</th><th>Lat</th><th>Lon</th><th>Radius</th></tr><tr><td>2</td><td></td><td>#co(1771)#</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>10.361465</td><td>-84.476996666667</td><td>0.1</td></tr></table>string(408) "select place_id from search_name where ST_DWithin(centroid, ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326), 0.1) order by ST_Distance(centroid, ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326)) ASC, ST_Distance(ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326), centroid) asc, (case when importance = 0 OR importance IS NULL then 0.75-(search_rank::float/40) else importance end) DESC limit 2"
355<br><b>Place IDs:</b> array(2) {
356  [0]=>
357  string(7) "8326150"
358  [1]=>
359  string(10) "5990796115"
360}
361<hr><b>Search Loop, group 2, loop 5</b><table border="1"><tr><th>rank</th><th>Name Tokens</th><th>Name Not</th><th>Address Tokens</th><th>Address Not</th><th>country</th><th>operator</th><th>class</th><th>type</th><th>house#</th><th>Lat</th><th>Lon</th><th>Radius</th></tr><tr><td>2</td><td></td><td></td><td></td><td></td><td></td><td>near</td><td>place</td><td>county</td><td></td><td>10.361465</td><td>-84.476996666667</td><td>0.1</td></tr></table>string(409) "select place_id from search_name where ST_DWithin(centroid, ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326), 0.1) order by ST_Distance(centroid, ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326)) ASC, ST_Distance(ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326), centroid) asc, (case when importance = 0 OR importance IS NULL then 0.75-(search_rank::float/40) else importance end) DESC limit 50"
362string(521) "select min(rank_search) from placex where place_id in (8326150,5990796115,5990796545,5990796544,3670718864,3670718589,40121621,88567293,89449003,88975223,89359856,88407220,18252874,88240453,88601958,6007392614,18825928,89505177,6007410734,6007410762,88241447,3670718872,59616725,4242317,11218392,11493810,61918120,11124290,61937070,17450953,18036658,18459061,17451990,16813568,17486088,77264143,77264152,16571292,17155507,16561252,77927007,78308055,41061067,78148514,93953687,76899756,76968080,78001707,78148532,19591610)"
363string(534) "select place_id from placex where place_id in (8326150,5990796115,5990796545,5990796544,3670718864,3670718589,40121621,88567293,89449003,88975223,89359856,88407220,18252874,88240453,88601958,6007392614,18825928,89505177,6007410734,6007410762,88241447,3670718872,59616725,4242317,11218392,11493810,61918120,11124290,61937070,17450953,18036658,18459061,17451990,16813568,17486088,77264143,77264152,16571292,17155507,16561252,77927007,78308055,41061067,78148514,93953687,76899756,76968080,78001707,78148532,19591610) and rank_search < 23"
364string(368) "select distinct l.place_id,ST_Distance(ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326), l.centroid) from place_classtype_place_county as l,placex as f where f.place_id in (4242317,3670718864,61937070,61918120,8326150) and ST_DWithin(l.centroid, f.centroid, 0.05) order by ST_Distance(ST_SetSRID(ST_Point(-84.476996666667,10.361465),4326), l.centroid) asc limit 2"
365<br><b>Place IDs:</b> array(0) {
366}
367<hr>string(2497) "select osm_type,osm_id,class,type,admin_level,rank_search,rank_address,min(place_id) as place_id,calculated_country_code as country_code,get_address_by_language(place_id, ARRAY['short_name:en-US','short_name:en','short_name:es','name:en-US','name:en','name:es','place_name:en-US','place_name:en','place_name:es','official_name:en-US','official_name:en','official_name:es','short_name','name','place_name','official_name','ref','type']) as langaddress,get_name_by_language(name, ARRAY['short_name:en-US','short_name:en','short_name:es','name:en-US','name:en','name:es','place_name:en-US','place_name:en','place_name:es','official_name:en-US','official_name:en','official_name:es','short_name','name','place_name','official_name','ref','type']) as placename,get_name_by_language(name, ARRAY['ref']) as ref,avg(ST_X(centroid)) as lon,avg(ST_Y(centroid)) as lat, coalesce(importance,0.75-(rank_search::float/40)) as importance, (select max(p.importance*(p.rank_address+2)) from place_addressline s, placex p where s.place_id = min(placex.place_id) and p.place_id = s.address_place_id and s.isaddress and p.importance is not null) as addressimportance, (extratags->'place') as extra_place from placex where place_id in (8326150,5990796115) and (placex.rank_address between 0 and 30  OR (extratags->'place') = 'city') and linked_place_id is null group by osm_type,osm_id,class,type,admin_level,rank_search,rank_address,calculated_country_code,importance,langaddress ,placename ,ref ,extratags->'place'  union select 'T' as osm_type,place_id as osm_id,'place' as class,'house' as type,null as admin_level,30 as rank_search,30 as rank_address,min(place_id) as place_id,'us' as country_code,get_address_by_language(place_id, ARRAY['short_name:en-US','short_name:en','short_name:es','name:en-US','name:en','name:es','place_name:en-US','place_name:en','place_name:es','official_name:en-US','official_name:en','official_name:es','short_name','name','place_name','official_name','ref','type']) as langaddress,null as placename,null as ref,avg(ST_X(centroid)) as lon,avg(ST_Y(centroid)) as lat, -1.15 as importance, (select max(p.importance*(p.rank_address+2)) from place_addressline s, placex p where s.place_id = min(location_property_tiger.place_id) and p.place_id = s.address_place_id and s.isaddress and p.importance is not null) as addressimportance, null as extra_place from location_property_tiger where place_id in (8326150,5990796115) and 30 between 0 and 30 group by place_id order by importance desc"