Differences

This shows you the differences between two versions of the page.

Link to this comparison view

admin:indexing:autocomplete:sql [2011/01/24 21:42]
els
admin:indexing:autocomplete:sql [2016/06/28 22:38]
Line 1: Line 1:
-~~NOTOC~~ 
  
-{{page>:​top_add&​nofooter&​noeditbtn}} 
- 
-====== Administration:​ Omnidex Indexing ====== 
- 
-===== AutoComplete ===== 
- 
-[[admin:​indexing:​autocomplete:​home|Overview]] | 
-[[admin:​indexing:​autocomplete:​example|Example]] | 
-**[[admin:​indexing:​autocomplete:​sql|SQL]]** | 
-[[admin:​indexing:​autocomplete:​optimization|Optimization]] | 
-[[admin:​indexing:​autocomplete:​tips|Tips]] 
- 
----- 
- 
- 
- 
-==== The SQL Behind AutoComplete ==== 
- 
-The SQL behind AutoComplete is a simple query requesting grouped counts. ​ For QuickText indexes, it is necessary to use an optimization setting so that one value is returned for each parsed word, rather than one value for each row.  ​ 
- 
-The following SQL statement provides the results shown in the previous example: 
- 
-<code sql> 
-  select ​       FNAME, count(*) ​ 
-    from        LIST  
-    where       ​FNAME='​Wi*' ​ 
-    group by    FNAME  
-    order by    2 desc  
-    with        optimization=distinct_key ​ 
-</​code>​ 
- 
-This SQL statement will provide results that can then be placed into drop-down boxes as needed: 
- 
-<code sql> 
->   ​select ​       FNAME, count(*) 
->> ​    ​from ​       LIST 
->> ​    ​where ​      ​FNAME='​Wi*'​ 
->> ​    group by    FNAME 
->> ​    order by    2 desc 
->> ​    ​with ​       optimization=distinct_k 
- 
-FNAME                     ​COUNT('​*'​) 
------------------------- ​ ---------- 
-WILLIAM ​                      ​118130 
-WILLIE ​                        19307 
-WILMA                           5075 
-WILLARD ​                        2350 
-WILLIS ​                         1661 
-WILBUR ​                         1660 
-WINIFRED ​                       1365 
-WILBERT ​                        1357 
-WILSON ​                         1351 
-WILFRED ​                        1141 
-WINSTON ​                         946 
-WILL                             826 
-WILLA                            800 
-WINNIE ​                          800 
-WILFREDO ​                        698 
-WILLIAMS ​                        626 
-WILEY                            536 
-WILDA                            457 
-WINFRED ​                         445 
-WILFORD ​                         428 
-WILMER ​                          367 
-WINONA ​                          366 
-WILHELMINA ​                      348 
-WILBURN ​                         345 
-WILTON ​                          280 
-WILLY                            216 
-WINNIFRED ​                       212 
-WINDY                            201 
-WINFORD ​                         176 
-WILBER ​                          175 
-WILLENE ​                         163 
-WILLIAN ​                         155 
-WILLIA ​                          113 
-WILLETTE ​                        104 
-WILLIEMAE ​                        59 
-WINTER ​                           58 
-WILLODEAN ​                        48 
-WILLENA ​                          47 
-WILHEMINA ​                        43 
-WILLOW ​                           39 
-WILLETTA ​                         35 
-41 rows returned 
-</​code>​ 
- 
-=====  ===== 
- 
-**[[admin:​indexing:​autocomplete:​example|Prev]]** | 
-**[[admin:​indexing:​autocomplete:​optimization|Next]]** 
- 
-====== Additional Resources ====== 
- 
-See also:  
- 
-{{page>:​admin:​indexing:​see_also&​nofooter&​noeditbtn}} 
- 
-{{page>:​bottom_add&​nofooter&​noeditbtn}} 
 
Back to top
admin/indexing/autocomplete/sql.txt ยท Last modified: 2016/06/28 22:38 (external edit)