Greetings!
On Nov 14, 1:28 pm, "madhav singh" <
madhavsin...@gmail.com> wrote:
> I want to implement something search as you type tool, but this tool reads
> from static file.
Aye.
> How can i provide query suggest (auto-complete) words that have been index
> by crawler?
I believe that one is what they call an "exercise left to the
reader." ;)
Seriously though, there's a subtle-but-important difference here,
which you drew a bead on in your initial post. "Search-as-you-type" is
indeed _not_ the same as "query suggest." The former provides results
while the latter provides queries.
WIth that, dynamic results clustering _might_ be the closest thing to
query suggestion on the GSA.
In this case, you'll need to get familiar with the /cluster service on
your GSA (vs. /search). It works just like a search query (same
params), but with two important differences:
1. There's a new parameter, coutput (cluster output?). Set to xml or
json.
2. If using json, HTTP POST must be used (though the query string
remains).
To experiment, try a search directly on the GSA, then change this part
of the search URI:
/search?
... to this instead:
/cluster?coutput=xml&
View source (it may appear to be an empty page depending on your
browser) and you'll see the XML.
As an aside, notice this part:
<algorithm data="Concepts"/>
(I wonder if there might be other algorithms lurking within? Hmm!)
If you want to see the JSON response, use coutput=json instead, then
use a helper app (e.g., wget) that lets you issue a POST request.
Again, keep the query string as-is. No need to turn the params into a
POST-style payload.
Have a look at /cluster.js on the root of your GSA for the JSON format
(which, in turn, gives you insight into the XML as well).
Hope this helps!
--
Joe D'Andrea
Liquid Joe LLC
www.liquidjoe.biz
+1 (908) 781-0323