List Info

Thread: How to write an AutoComplete Schema for Json?




How to write an AutoComplete Schema for Json?
user name
2006-09-15 10:27:41
Hi, greetings!
 
have a JSON data structure like this:
==============================
[   
    {
         "eid":"1520199",
        "keyword":"hello",
 &nbsp;   &nbsp;  "definition":"h?¨Alo,h?¨Alo;h?¨lou,he¨lou< hel.lo >\n[³£ÓÃ×Ö]\n(Ò²×÷ hul.lo)\n<<¸Ð̾´Ê>>;\nι! ¹þÃÞ!\nÓÃì¶Îʺò¡¢½Óµç»°¼°±í´ï¾ªÑÈ\n<<Ãû´Ê>>;\npl. hellos\n"hello" µÄºôÉù¼°ÎʺòÓï\n<&lt;²»¼°Îﶯ´Ê>>\nhelloed, hello.ing, helloes\n˵ "hello"\r\n",
 &nbsp;   &nbsp;  "bookid":"2"
 &nbsp;  },
 &nbsp;  {
 &nbsp;   &nbsp;  "eid":"1520200",
 &nbsp;   &nbsp;  "keyword":"hello girl",
 &nbsp;   &nbsp;  "definition":"< hello girl >\n<<Ãû´Ê>;>\nÅ®½ÓÏßÉú\r\n","bookid":"2"
 &nbsp;  }
]
===============
and i have tried to code a Data Source like
"
SAutoCompDataSource= new YAHOO.widget.DS_XHR("pdict-backend.php", ["", "keyword", "definition", "eid"]);&nbsp;  SAutoCompDataSource.queryMatchContains = true; 
SAutoCompDataSource.responseType = SAutoCompDataSource.TYPE_JSON;
SAutoCompDataSource.scriptQueryAppend = "action=SearchAutoComp";
SAutoCompDataSource.maxCacheEntries = 0; &nbsp;
var SearchAutoComp=new YAHOO.widget.AutoComplete("tfSearchWord","dvAutoComplete", SAutoCompDataSource); 
// Container will expand and collapse vertically
SearchAutoComp.animVert = true;
 
// Container will expand and collapse horizontally
SearchAutoComp.animHoriz = true;
 
// Container animation will take 2 seconds to complete
SearchAutoComp.animSpeed = 1;
 
// ...or disable query delimiters altogether (default)
SearchAutoComp.delimChar = "";
 
// Display up to 20 results in the container
SearchAutoComp.maxResultsDisplayed = 10;
// Require user to type at least 3 characters before triggering a query
SearchAutoComp.minQueryLength =2;
SearchAutoComp.queryDelay = 1;
SearchAutoComp.highlightClassName = "clsSAutoCompHighlight"; 
SearchAutoComp.prehighlightClassName = "clsSAutoCompPreHighlight";
SearchAutoComp.useShadow = true; ;
SearchAutoComp.typeAhead = true;
SearchAutoComp.allowBrowserAutocomplete = false;&nbsp;
"
=======
since my data contains no "N-depth.object.notation.to.each.result" as the documentation tells, i dont know how to make the entire thing working, especially with the Schema part.
 
please&nbsp;help me ..
 

= = = = = = = = = = = = = = = = = = = = = =

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÖÂ
Àñ£¡

&nbsp;
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡[CN]Yi-Mu-Ke-IMKOW
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡yeah.net">imkowyeah.net
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2006-09-15
 
__._,_.___ __,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )