Unable to get search result using Javascript client..

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to get search result using Javascript client..

SUNIL KUMAR DASH
Dear All, I am unable to connect and get the search result from my  
solr server (7.3.1 with nutch 1.15 ) from a simple JavaScript client..  
responseText showing blank. But on the standalone solr server I am  
able to search the keyword and results are displayed ( core name=nutch  
)   My code goes like this. What could be the problem..Thanks in  
advance..
Solr Search

SOLR SEARCH [ FROM JAVASCRIPT ]





Regards Sunil Kumar
------------------------------------------------------------------------------
IMPORTANT NOTE:

ISRO Satellite Centre (ISAC) was renamed as U R Rao Satellite Centre (URSC).
Hence, the existing domain (isac.gov.in) is changed to new domain ursc.gov.in
resulting into change of e-mail address from [hidden email] to  
[hidden email].
Please note this change and update your contact details for new domain  
(ursc.gov.in).
------------------------------------------------------------------------------
Confidentiality Notice: This e-mail message, including any attachments, is for
the sole use of the intended recipient(s) and may contain confidential and
privileged information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of the original
message.
------------------------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: Unable to get search result using Javascript client..

Sebastian Nagel-2
Hi,

this question is better asked on the Solr user mailing list
as Nutch people are not necessarily familiar with Solr on a deep level.

Please also share more details - which JavaScript client, the error message,
the log messages of the Solr server at this time. This helps to trace the
error down and detect the reason.

Best,
Sebastian


On 9/28/20 1:29 PM, SUNIL KUMAR DASH wrote:

> Dear All, I am unable to connect and get the search result from my solr server (7.3.1 with nutch 1.15 ) from a simple JavaScript client..
> responseText showing blank. But on the standalone solr server I am able to search the keyword and results are displayed ( core name=nutch
> )   My code goes like this. What could be the problem..Thanks in advance..
> Solr Search
>
> SOLR SEARCH [ FROM JAVASCRIPT ]
>
>
>
>
>
> Regards Sunil Kumar
> ------------------------------------------------------------------------------
> IMPORTANT NOTE:
>
> ISRO Satellite Centre (ISAC) was renamed as U R Rao Satellite Centre (URSC).
> Hence, the existing domain (isac.gov.in) is changed to new domain ursc.gov.in
> resulting into change of e-mail address from [hidden email] to [hidden email].
> Please note this change and update your contact details for new domain (ursc.gov.in).
> ------------------------------------------------------------------------------
> Confidentiality Notice: This e-mail message, including any attachments, is for
> the sole use of the intended recipient(s) and may contain confidential and
> privileged information. Any unauthorized review, use, disclosure or
> distribution is prohibited. If you are not the intended recipient, please
> contact the sender by reply e-mail and destroy all copies of the original
> message.
> ------------------------------------------------------------------------------
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Unable to get search result using Javascript client..

SUNIL KUMAR DASH
Thanks Sebastian,
surely I will ask this on Solr mailing list. This is my javascript
code ,from where I am calling solr ,which has a loaded nutch core
(index).  My java script client ( runs on TOMCAT server) and Solr
server are on the same machine (10.21.6.100) . May be due to cross
domain references issues OR something is missing I don't know.
I expected Response from Solr server (search result) as raw JASON
object. Thanks .

Rgds
Sunil Kumar


<html>
<head>  <title>Solr Search </title> </head>
<body>
    <script language="Javascript">
    function search()
    {
     var xmlHttpReq =false;
     var  xmlHttpClient=this;

     var hostURL='http://10.21.6.100:8983/solr/nutch/select';
     var querystring=document.getElementById("querystring").value;
     qstr='q='+escape(querystring)+"&fl=content";

     if(window.XMLHttpRequest){  xmlHttpClient.xmlHttpReq=new
XMLHttpRequest(); }

     xmlHttpClient.xmlHttpReq.open('POST',hostURL,true);


xmlHttpClient.xmlHttpReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');

     xmlHttpClient.xmlHttpReq.send(qstr);

     xmlHttpClient.xmlHttpReq.onreadystatechange=function()
      {
      if(xmlHttpClient.xmlHttpReq.readyState ==4 )
            { showresponse(xmlHttpClient.xmlHttpReq.responseText);}
      }

    }

     function showResponse(str)
    {
       document.getElementById("responsestring").innerHTML=str;
    }

    </script>

     <h3>Solr Search [ From Javascript ]</h3>
    <div align='center'>
     <input id="querystring" name="querystring" type="text"
placeholder="Search here..">
     <input value="search" type="button" onClick='search();'>
     <p>
       <div id="result"> </div>
       <div id="responsestring"> </div>
     </div>
</body>


----- Message from Sebastian Nagel
<[hidden email]> ---------
    Date: Thu, 1 Oct 2020 09:59:48 +0200
    From: Sebastian Nagel <[hidden email]>
Reply-To: [hidden email]
Subject: Re: Unable to get search result using Javascript client..
      To: [hidden email]

> Hi,
>
> this question is better asked on the Solr user mailing list
> as Nutch people are not necessarily familiar with Solr on a deep level.
>
> Please also share more details - which JavaScript client, the error message,
> the log messages of the Solr server at this time. This helps to trace the
> error down and detect the reason.
>
> Best,
> Sebastian
>
> On 9/28/20 1:29 PM, SUNIL KUMAR DASH wrote:
>> Dear All, I am unable to connect and get the search result from my
>> solr server (7.3.1 with nutch 1.15 ) from a simple JavaScript
>> client..
>> responseText showing blank. But on the standalone solr server I am
>> able to search the keyword and results are displayed ( core
>> name=nutch
>> )   My code goes like this. What could be the problem..Thanks in advance..
>> Solr Search
>>
>> SOLR SEARCH [ FROM JAVASCRIPT ]
>>
>> Regards Sunil Kumar
>> ------------------------------------------------------------------------------
>> IMPORTANT NOTE:
>>
>> ISRO Satellite Centre (ISAC) was renamed as U R Rao Satellite Centre (URSC).
>> Hence, the existing domain (isac.gov.in) is changed to new domain
>> ursc.gov.in
>> resulting into change of e-mail address from [hidden email] to
>> [hidden email].
>> Please note this change and update your contact details for new
>> domain (ursc.gov.in).
>> ------------------------------------------------------------------------------
>> Confidentiality Notice: This e-mail message, including any
>> attachments, is for
>> the sole use of the intended recipient(s) and may contain confidential and
>> privileged information. Any unauthorized review, use, disclosure or
>> distribution is prohibited. If you are not the intended recipient, please
>> contact the sender by reply e-mail and destroy all copies of the original
>> message.
>> ------------------------------------------------------------------------------
>
> ----- End message from Sebastian Nagel
> <[hidden email]> -----
>  
------------------------------------------------------------------------------
IMPORTANT NOTE:

ISRO Satellite Centre (ISAC) was renamed as U R Rao Satellite Centre (URSC).
Hence, the existing domain (isac.gov.in) is changed to new domain ursc.gov.in
resulting into change of e-mail address from [hidden email] to
[hidden email].
Please note this change and update your contact details for new domain
(ursc.gov.in).
------------------------------------------------------------------------------
Confidentiality Notice: This e-mail message, including any attachments, is for
the sole use of the intended recipient(s) and may contain confidential and
privileged information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of the original
message.
------------------------------------------------------------------------------