You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Avlesh Singh <av...@gmail.com> on 2009/11/01 03:07:39 UTC

Re: autocomplete

>
>
> "q=*:*&fq=ac:*all*&wt=json&rows=15&start=0&indent=on&omitHeader=true&json.wrf=?";
>
Why is the json.wrf not specified? Without the callback function, the string
that is return back is illegal javascript for the browser. You need to
specify this parameter which is a wrapper or a callback function. If you
specify json.wrf=foo, as soon as the browser gets a response, it would call
a function named foo (needs to already defined). Inside "foo" you can have
you own implementation to interpret and render this data.

Cheers
Avlesh

On Sat, Oct 31, 2009 at 12:13 AM, Ankit Bhatnagar <ab...@vantage.com>wrote:

>
> Hi guys,
>
> Enterprise 1.4 Solr Book (AutoComplete) says this works -
>
> My query looks like -
>
>
> "q=*:*&fq=ac:*all*&wt=json&rows=15&start=0&indent=on&omitHeader=true&json.wrf=?";
>
>
> And it returns three results
>
>
> {
>  "responseHeader":{
>  "status":0,
>  "QTime":38,
>  "params":{
>        "indent":"on",
>        "start":"0",
>        "q":"*:*",
>        "wt":"json",
>        "fq":"ac:*all*",
>        "rows":"15"}},
>  "response":{"numFound":3,"start":0,"docs":[
>        {
>         "id":"1",
>         "ac":"Can you show me all the results"},
>        {
>         "id":"2",
>         "ac":"Can you show all companies "},
>        {
>         "id":"3",
>         "ac":"Can you list all companies"}]
>  }}
>
>
>
> But browser says syntax error --
>
>
> Ankit
>
>
>
>
>
>
>
>
>
>
>
>
>
>

RE: autocomplete

Posted by Ankit Bhatnagar <ab...@vantage.com>.

Hey Avlesh,
Thanks for your reply.


-Ankit

-----Original Message-----
From: Avlesh Singh [mailto:avlesh@gmail.com] 
Sent: Saturday, October 31, 2009 10:08 PM
To: solr-user@lucene.apache.org
Subject: Re: autocomplete

>
>
> "q=*:*&fq=ac:*all*&wt=json&rows=15&start=0&indent=on&omitHeader=true&json.wrf=?";
>
Why is the json.wrf not specified? Without the callback function, the string
that is return back is illegal javascript for the browser. You need to
specify this parameter which is a wrapper or a callback function. If you
specify json.wrf=foo, as soon as the browser gets a response, it would call
a function named foo (needs to already defined). Inside "foo" you can have
you own implementation to interpret and render this data.

Cheers
Avlesh

On Sat, Oct 31, 2009 at 12:13 AM, Ankit Bhatnagar <ab...@vantage.com>wrote:

>
> Hi guys,
>
> Enterprise 1.4 Solr Book (AutoComplete) says this works -
>
> My query looks like -
>
>
> "q=*:*&fq=ac:*all*&wt=json&rows=15&start=0&indent=on&omitHeader=true&json.wrf=?";
>
>
> And it returns three results
>
>
> {
>  "responseHeader":{
>  "status":0,
>  "QTime":38,
>  "params":{
>        "indent":"on",
>        "start":"0",
>        "q":"*:*",
>        "wt":"json",
>        "fq":"ac:*all*",
>        "rows":"15"}},
>  "response":{"numFound":3,"start":0,"docs":[
>        {
>         "id":"1",
>         "ac":"Can you show me all the results"},
>        {
>         "id":"2",
>         "ac":"Can you show all companies "},
>        {
>         "id":"3",
>         "ac":"Can you list all companies"}]
>  }}
>
>
>
> But browser says syntax error --
>
>
> Ankit
>
>
>
>
>
>
>
>
>
>
>
>
>
>