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 Joel Nylund <jn...@yahoo.com> on 2009/11/04 16:48:18 UTC

how to use ajax-solr - example?

Hi, I looked at the documentation and I have no idea how to get  
started? Can someone point me to or show me an example of how to send  
a query to a solr server and paginate through the results using ajax- 
solr.

I would glady write a blog tutorial on how to do this if someone can  
get me started.

I dont know jquery but have used prototype & scriptaculous.

thanks
Joel


Re: how to use ajax-solr - example?

Posted by James McKinney <ja...@evolvingweb.ca>.
It seems the OP has found what he wanted, but just to clarify and update:

The AJAX Solr documentation has been massively expanded, and a demo site has
been created:

Demo: http://evolvingweb.github.com/ajax-solr/examples/reuters/index.html
Docs: http://evolvingweb.github.com/ajax-solr/

AJAX Solr is JavaScript framework-agnostic. If you prefer Prototype, use
Prototype. The documentation, however, is written in jQuery, as it is the
most popular framework.

Counter what Israel said, sending data only between JavaScript and Solr will
*not* limit you to one domain. In the demo site, for example, the HTML/JS is
on one domain and Solr is on another domain.

Cheers,

James


Israel Ekpo wrote:
> 
> On Wed, Nov 4, 2009 at 10:48 AM, Joel Nylund <jn...@yahoo.com> wrote:
> 
>> Hi, I looked at the documentation and I have no idea how to get started?
>> Can someone point me to or show me an example of how to send a query to a
>> solr server and paginate through the results using ajax-solr.
>>
>> I would glady write a blog tutorial on how to do this if someone can get
>> me
>> started.
>>
>> I dont know jquery but have used prototype & scriptaculous.
>>
>> thanks
>> Joel
>>
>>
> 
> Joel,
> 
> It will be best if you use a scripting language between Solr and
> JavaScript
> 
> This is becasue sending data only between JavaScript and Solr will limit
> you
> to only one domain name.
> 
> However, if you are using a scripting language between JavaScript and Solr
> you can use the scripting language to retrieve the request parameters from
> JavaScript and then same them to Solr with the response writer set to
> json.
> 
> This will cause Solr to send the response in JSON format which the
> scripting
> language can pass on to JavaScript.
> 
> This example here will cause Solr to return the response in JSON.
> 
> http://example.com:8443/solr/select?q=searchkeyword&wt=json
> 
> 
> -- 
> "Good Enough" is not good enough.
> To give anything less than your best is to sacrifice the gift.
> Quality First. Measure Twice. Cut Once.
> 
> 

-- 
View this message in context: http://old.nabble.com/how-to-use-ajax-solr---example--tp26198805p26763868.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: how to use ajax-solr - example?

Posted by Lance Norskog <go...@gmail.com>.
google "applying a diff patch"

http://www.linuxjournal.com/article/1237 looks like a good start.



On Thu, Nov 5, 2009 at 6:39 AM, Joel Nylund <jn...@yahoo.com> wrote:
> this is exactly what I was looking for, any directions how to install? I
> dont really understand how to use a .patch file.
>
> thanks
> Joel
>
> On Nov 4, 2009, at 9:16 PM, Lance Norskog wrote:
>
>> http://issues.apache.org/jira/browse/SOLR-1163
>>
>> This is a really nice index browser.
>>
>> On Wed, Nov 4, 2009 at 12:51 PM, Joel Nylund <jn...@yahoo.com> wrote:
>>>
>>> Hi Israel,
>>>
>>> I agree the idea of adding a scripting language in between is good, but I
>>> want something simple I can easily test my queries with data and scroll
>>> through the results. I have been using the browser and getting xml for
>>> now,
>>> but would like to save my queries in a simple html page and format the
>>> data.
>>>
>>> I figured this is something I can throw together in a few hours, but I
>>> also
>>> figured someone would have already done the work.
>>>
>>> thanks
>>> Joel
>>>
>>> On Nov 4, 2009, at 2:02 PM, Israel Ekpo wrote:
>>>
>>>> On Wed, Nov 4, 2009 at 10:48 AM, Joel Nylund <jn...@yahoo.com> wrote:
>>>>
>>>>> Hi, I looked at the documentation and I have no idea how to get
>>>>> started?
>>>>> Can someone point me to or show me an example of how to send a query to
>>>>> a
>>>>> solr server and paginate through the results using ajax-solr.
>>>>>
>>>>> I would glady write a blog tutorial on how to do this if someone can
>>>>> get
>>>>> me
>>>>> started.
>>>>>
>>>>> I dont know jquery but have used prototype & scriptaculous.
>>>>>
>>>>> thanks
>>>>> Joel
>>>>>
>>>>>
>>>>
>>>> Joel,
>>>>
>>>> It will be best if you use a scripting language between Solr and
>>>> JavaScript
>>>>
>>>> This is becasue sending data only between JavaScript and Solr will limit
>>>> you
>>>> to only one domain name.
>>>>
>>>> However, if you are using a scripting language between JavaScript and
>>>> Solr
>>>> you can use the scripting language to retrieve the request parameters
>>>> from
>>>> JavaScript and then same them to Solr with the response writer set to
>>>> json.
>>>>
>>>> This will cause Solr to send the response in JSON format which the
>>>> scripting
>>>> language can pass on to JavaScript.
>>>>
>>>> This example here will cause Solr to return the response in JSON.
>>>>
>>>> http://example.com:8443/solr/select?q=searchkeyword&wt=json
>>>>
>>>>
>>>> --
>>>> "Good Enough" is not good enough.
>>>> To give anything less than your best is to sacrifice the gift.
>>>> Quality First. Measure Twice. Cut Once.
>>>
>>>
>>
>>
>>
>> --
>> Lance Norskog
>> goksron@gmail.com
>
>



-- 
Lance Norskog
goksron@gmail.com

Re: how to use ajax-solr - example?

Posted by Erik Hatcher <er...@gmail.com>.
Another option is the VelocityResponseWriter, pretty smooth for quick  
and dirty UI -

    http://www.lucidimagination.com/blog/2009/11/04/solritas-solr-1-4s-hidden-gem/

	Erik


On Nov 5, 2009, at 6:39 AM, Joel Nylund wrote:

> this is exactly what I was looking for, any directions how to  
> install? I dont really understand how to use a .patch file.
>
> thanks
> Joel
>
> On Nov 4, 2009, at 9:16 PM, Lance Norskog wrote:
>
>> http://issues.apache.org/jira/browse/SOLR-1163
>>
>> This is a really nice index browser.
>>
>> On Wed, Nov 4, 2009 at 12:51 PM, Joel Nylund <jn...@yahoo.com>  
>> wrote:
>>> Hi Israel,
>>>
>>> I agree the idea of adding a scripting language in between is  
>>> good, but I
>>> want something simple I can easily test my queries with data and  
>>> scroll
>>> through the results. I have been using the browser and getting xml  
>>> for now,
>>> but would like to save my queries in a simple html page and format  
>>> the data.
>>>
>>> I figured this is something I can throw together in a few hours,  
>>> but I also
>>> figured someone would have already done the work.
>>>
>>> thanks
>>> Joel
>>>
>>> On Nov 4, 2009, at 2:02 PM, Israel Ekpo wrote:
>>>
>>>> On Wed, Nov 4, 2009 at 10:48 AM, Joel Nylund <jn...@yahoo.com>  
>>>> wrote:
>>>>
>>>>> Hi, I looked at the documentation and I have no idea how to get  
>>>>> started?
>>>>> Can someone point me to or show me an example of how to send a  
>>>>> query to a
>>>>> solr server and paginate through the results using ajax-solr.
>>>>>
>>>>> I would glady write a blog tutorial on how to do this if someone  
>>>>> can get
>>>>> me
>>>>> started.
>>>>>
>>>>> I dont know jquery but have used prototype & scriptaculous.
>>>>>
>>>>> thanks
>>>>> Joel
>>>>>
>>>>>
>>>>
>>>> Joel,
>>>>
>>>> It will be best if you use a scripting language between Solr and
>>>> JavaScript
>>>>
>>>> This is becasue sending data only between JavaScript and Solr  
>>>> will limit
>>>> you
>>>> to only one domain name.
>>>>
>>>> However, if you are using a scripting language between JavaScript  
>>>> and Solr
>>>> you can use the scripting language to retrieve the request  
>>>> parameters from
>>>> JavaScript and then same them to Solr with the response writer  
>>>> set to
>>>> json.
>>>>
>>>> This will cause Solr to send the response in JSON format which the
>>>> scripting
>>>> language can pass on to JavaScript.
>>>>
>>>> This example here will cause Solr to return the response in JSON.
>>>>
>>>> http://example.com:8443/solr/select?q=searchkeyword&wt=json
>>>>
>>>>
>>>> --
>>>> "Good Enough" is not good enough.
>>>> To give anything less than your best is to sacrifice the gift.
>>>> Quality First. Measure Twice. Cut Once.
>>>
>>>
>>
>>
>>
>> -- 
>> Lance Norskog
>> goksron@gmail.com
>


Re: how to use ajax-solr - example?

Posted by Joel Nylund <jn...@yahoo.com>.
this is exactly what I was looking for, any directions how to install?  
I dont really understand how to use a .patch file.

thanks
Joel

On Nov 4, 2009, at 9:16 PM, Lance Norskog wrote:

> http://issues.apache.org/jira/browse/SOLR-1163
>
> This is a really nice index browser.
>
> On Wed, Nov 4, 2009 at 12:51 PM, Joel Nylund <jn...@yahoo.com>  
> wrote:
>> Hi Israel,
>>
>> I agree the idea of adding a scripting language in between is good,  
>> but I
>> want something simple I can easily test my queries with data and  
>> scroll
>> through the results. I have been using the browser and getting xml  
>> for now,
>> but would like to save my queries in a simple html page and format  
>> the data.
>>
>> I figured this is something I can throw together in a few hours,  
>> but I also
>> figured someone would have already done the work.
>>
>> thanks
>> Joel
>>
>> On Nov 4, 2009, at 2:02 PM, Israel Ekpo wrote:
>>
>>> On Wed, Nov 4, 2009 at 10:48 AM, Joel Nylund <jn...@yahoo.com>  
>>> wrote:
>>>
>>>> Hi, I looked at the documentation and I have no idea how to get  
>>>> started?
>>>> Can someone point me to or show me an example of how to send a  
>>>> query to a
>>>> solr server and paginate through the results using ajax-solr.
>>>>
>>>> I would glady write a blog tutorial on how to do this if someone  
>>>> can get
>>>> me
>>>> started.
>>>>
>>>> I dont know jquery but have used prototype & scriptaculous.
>>>>
>>>> thanks
>>>> Joel
>>>>
>>>>
>>>
>>> Joel,
>>>
>>> It will be best if you use a scripting language between Solr and
>>> JavaScript
>>>
>>> This is becasue sending data only between JavaScript and Solr will  
>>> limit
>>> you
>>> to only one domain name.
>>>
>>> However, if you are using a scripting language between JavaScript  
>>> and Solr
>>> you can use the scripting language to retrieve the request  
>>> parameters from
>>> JavaScript and then same them to Solr with the response writer set  
>>> to
>>> json.
>>>
>>> This will cause Solr to send the response in JSON format which the
>>> scripting
>>> language can pass on to JavaScript.
>>>
>>> This example here will cause Solr to return the response in JSON.
>>>
>>> http://example.com:8443/solr/select?q=searchkeyword&wt=json
>>>
>>>
>>> --
>>> "Good Enough" is not good enough.
>>> To give anything less than your best is to sacrifice the gift.
>>> Quality First. Measure Twice. Cut Once.
>>
>>
>
>
>
> -- 
> Lance Norskog
> goksron@gmail.com


Re: how to use ajax-solr - example?

Posted by Lance Norskog <go...@gmail.com>.
http://issues.apache.org/jira/browse/SOLR-1163

This is a really nice index browser.

On Wed, Nov 4, 2009 at 12:51 PM, Joel Nylund <jn...@yahoo.com> wrote:
> Hi Israel,
>
> I agree the idea of adding a scripting language in between is good, but I
> want something simple I can easily test my queries with data and scroll
> through the results. I have been using the browser and getting xml for now,
> but would like to save my queries in a simple html page and format the data.
>
> I figured this is something I can throw together in a few hours, but I also
> figured someone would have already done the work.
>
> thanks
> Joel
>
> On Nov 4, 2009, at 2:02 PM, Israel Ekpo wrote:
>
>> On Wed, Nov 4, 2009 at 10:48 AM, Joel Nylund <jn...@yahoo.com> wrote:
>>
>>> Hi, I looked at the documentation and I have no idea how to get started?
>>> Can someone point me to or show me an example of how to send a query to a
>>> solr server and paginate through the results using ajax-solr.
>>>
>>> I would glady write a blog tutorial on how to do this if someone can get
>>> me
>>> started.
>>>
>>> I dont know jquery but have used prototype & scriptaculous.
>>>
>>> thanks
>>> Joel
>>>
>>>
>>
>> Joel,
>>
>> It will be best if you use a scripting language between Solr and
>> JavaScript
>>
>> This is becasue sending data only between JavaScript and Solr will limit
>> you
>> to only one domain name.
>>
>> However, if you are using a scripting language between JavaScript and Solr
>> you can use the scripting language to retrieve the request parameters from
>> JavaScript and then same them to Solr with the response writer set to
>> json.
>>
>> This will cause Solr to send the response in JSON format which the
>> scripting
>> language can pass on to JavaScript.
>>
>> This example here will cause Solr to return the response in JSON.
>>
>> http://example.com:8443/solr/select?q=searchkeyword&wt=json
>>
>>
>> --
>> "Good Enough" is not good enough.
>> To give anything less than your best is to sacrifice the gift.
>> Quality First. Measure Twice. Cut Once.
>
>



-- 
Lance Norskog
goksron@gmail.com

Re: how to use ajax-solr - example?

Posted by Joel Nylund <jn...@yahoo.com>.
Hi Israel,

I agree the idea of adding a scripting language in between is good,  
but I want something simple I can easily test my queries with data and  
scroll through the results. I have been using the browser and getting  
xml for now, but would like to save my queries in a simple html page  
and format the data.

I figured this is something I can throw together in a few hours, but I  
also figured someone would have already done the work.

thanks
Joel

On Nov 4, 2009, at 2:02 PM, Israel Ekpo wrote:

> On Wed, Nov 4, 2009 at 10:48 AM, Joel Nylund <jn...@yahoo.com>  
> wrote:
>
>> Hi, I looked at the documentation and I have no idea how to get  
>> started?
>> Can someone point me to or show me an example of how to send a  
>> query to a
>> solr server and paginate through the results using ajax-solr.
>>
>> I would glady write a blog tutorial on how to do this if someone  
>> can get me
>> started.
>>
>> I dont know jquery but have used prototype & scriptaculous.
>>
>> thanks
>> Joel
>>
>>
>
> Joel,
>
> It will be best if you use a scripting language between Solr and  
> JavaScript
>
> This is becasue sending data only between JavaScript and Solr will  
> limit you
> to only one domain name.
>
> However, if you are using a scripting language between JavaScript  
> and Solr
> you can use the scripting language to retrieve the request  
> parameters from
> JavaScript and then same them to Solr with the response writer set  
> to json.
>
> This will cause Solr to send the response in JSON format which the  
> scripting
> language can pass on to JavaScript.
>
> This example here will cause Solr to return the response in JSON.
>
> http://example.com:8443/solr/select?q=searchkeyword&wt=json
>
>
> -- 
> "Good Enough" is not good enough.
> To give anything less than your best is to sacrifice the gift.
> Quality First. Measure Twice. Cut Once.


Re: how to use ajax-solr - example?

Posted by Israel Ekpo <is...@gmail.com>.
On Wed, Nov 4, 2009 at 10:48 AM, Joel Nylund <jn...@yahoo.com> wrote:

> Hi, I looked at the documentation and I have no idea how to get started?
> Can someone point me to or show me an example of how to send a query to a
> solr server and paginate through the results using ajax-solr.
>
> I would glady write a blog tutorial on how to do this if someone can get me
> started.
>
> I dont know jquery but have used prototype & scriptaculous.
>
> thanks
> Joel
>
>

Joel,

It will be best if you use a scripting language between Solr and JavaScript

This is becasue sending data only between JavaScript and Solr will limit you
to only one domain name.

However, if you are using a scripting language between JavaScript and Solr
you can use the scripting language to retrieve the request parameters from
JavaScript and then same them to Solr with the response writer set to json.

This will cause Solr to send the response in JSON format which the scripting
language can pass on to JavaScript.

This example here will cause Solr to return the response in JSON.

http://example.com:8443/solr/select?q=searchkeyword&wt=json


-- 
"Good Enough" is not good enough.
To give anything less than your best is to sacrifice the gift.
Quality First. Measure Twice. Cut Once.