Trouble querying Solr from JavaScript and displaying results, getting nothingHow do I remove a property from a JavaScript object?How do you get a timestamp in JavaScript?How can I get query string values in JavaScript?How can I display a JavaScript object?How to get the value from the GET parameters?Get the current URL with JavaScript?Get selected value in dropdown list using JavaScript?How do I get the current date in JavaScript?Get selected text from a drop-down list (select box) using jQueryHow do I remove a particular element from an array in JavaScript?
Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?
Why is the design of haulage companies so “special”?
When blogging recipes, how can I support both readers who want the narrative/journey and ones who want the printer-friendly recipe?
Do Phineas and Ferb ever actually get busted in real time?
Why are 150k or 200k jobs considered good when there are 300k+ births a month?
How do we improve the relationship with a client software team that performs poorly and is becoming less collaborative?
How can I fix this gap between bookcases I made?
How can I hide my bitcoin transactions to protect anonymity from others?
"which" command doesn't work / path of Safari?
I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine
How can the DM most effectively choose 1 out of an odd number of players to be targeted by an attack or effect?
Example of a relative pronoun
How to add power-LED to my small amplifier?
What is the command to reset a PC without deleting any files
Motorized valve interfering with button?
How old can references or sources in a thesis be?
How long does it take to type this?
Email Account under attack (really) - anything I can do?
How is it possible for user to changed after storage was encrypted? (on OS X, Android)
What do you call a Matrix-like slowdown and camera movement effect?
Banach space and Hilbert space topology
How to report a triplet of septets in NMR tabulation?
How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?
Why don't electron-positron collisions release infinite energy?
Trouble querying Solr from JavaScript and displaying results, getting nothing
How do I remove a property from a JavaScript object?How do you get a timestamp in JavaScript?How can I get query string values in JavaScript?How can I display a JavaScript object?How to get the value from the GET parameters?Get the current URL with JavaScript?Get selected value in dropdown list using JavaScript?How do I get the current date in JavaScript?Get selected text from a drop-down list (select box) using jQueryHow do I remove a particular element from an array in JavaScript?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am trying working off of https://wiki.apache.org/solr/SolJSON tutorial. I have put my url for solr in the code, copied from solr admin query result to make sure the query should return something.
I try typing in "title:Asian" into text box (that field/search term combo returned results in the admin console query) but when the button is hit, textbox just clears and nothing in output spot.
I used the dev tools from [F12] key of browser to check console and see there was no errors given there, such as for syntax, so not due to that.
Perhaps I am understanding how the url for query works or should be here? If I leave out local host part as shown I just get error for not specifying local full path.
Does anyone see anything wrong here, or have any ideas/tips of what more to do to try and solve the issue?
[ If I must do/add anything else to make good/better post here, please do explain so I can fix :) ]
<html>
<head>
<title>Solr Ajax Example</title>
<meta charset="UTF-8">
<script language="Javascript">
// derived from http://www.degraeve.com/reference/simple-ajax-example.php
function xmlhttpPost(strURL)
var xmlHttpReq = false;
var self = this;
if (window.XMLHttpRequest) // Mozilla/Safari
self.xmlHttpReq = new XMLHttpRequest();
else if (window.ActiveXObject) // IE
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
self.xmlHttpReq.open('POST', strURL, true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function()
if (self.xmlHttpReq.readyState == 4)
updatepage(self.xmlHttpReq.responseText);
;
var params = getstandardargs().concat(getquerystring());
var strData = params.join('&');
self.xmlHttpReq.send(strData);
//document.getElementById("raw").innerHTML = strData;
return false;
function getstandardargs()
var params = [
'wt=json'
, 'indent=on'
, 'hl=true'
];
return params;
function getquerystring()
var form = document.forms['f1'];
var query = form.query.value;
qstr = 'q=' + escape(query);
return qstr;
// this function does all the work of parsing the solr response and updating the page.
function updatepage(str)
document.getElementById("raw").innerHTML = str;
var rsp = eval("("+str+")"); // use eval to parse Solr's JSON response
var html = "<br>numFound=" + rsp.response.numFound;
var first = rsp.response.docs[0];
html += "<br>product name=" + first.name;
var hl = rsp.highlighting[first.id];
if (hl.name != null) html += "<br>name highlighted: " + hl.name[0];
if (hl.features != null) html += "<br>features highligted: " + hl.features[0];
document.getElementById("result").innerHTML = html;
</script>
</head>
<body>
<form name="f1" onsubmit='xmlhttpPost("http://localhost:8983/solr/myCore/select?")'>
<p>query: <input name="query" type="text">
<input value="Go" type="submit"></p>
<div id="result"></div>
<p/><pre>Raw JSON String/output: <div id="raw"></div></pre>
</form>
</body>
</html>javascript json apache solr
|
show 1 more comment
I am trying working off of https://wiki.apache.org/solr/SolJSON tutorial. I have put my url for solr in the code, copied from solr admin query result to make sure the query should return something.
I try typing in "title:Asian" into text box (that field/search term combo returned results in the admin console query) but when the button is hit, textbox just clears and nothing in output spot.
I used the dev tools from [F12] key of browser to check console and see there was no errors given there, such as for syntax, so not due to that.
Perhaps I am understanding how the url for query works or should be here? If I leave out local host part as shown I just get error for not specifying local full path.
Does anyone see anything wrong here, or have any ideas/tips of what more to do to try and solve the issue?
[ If I must do/add anything else to make good/better post here, please do explain so I can fix :) ]
<html>
<head>
<title>Solr Ajax Example</title>
<meta charset="UTF-8">
<script language="Javascript">
// derived from http://www.degraeve.com/reference/simple-ajax-example.php
function xmlhttpPost(strURL)
var xmlHttpReq = false;
var self = this;
if (window.XMLHttpRequest) // Mozilla/Safari
self.xmlHttpReq = new XMLHttpRequest();
else if (window.ActiveXObject) // IE
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
self.xmlHttpReq.open('POST', strURL, true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function()
if (self.xmlHttpReq.readyState == 4)
updatepage(self.xmlHttpReq.responseText);
;
var params = getstandardargs().concat(getquerystring());
var strData = params.join('&');
self.xmlHttpReq.send(strData);
//document.getElementById("raw").innerHTML = strData;
return false;
function getstandardargs()
var params = [
'wt=json'
, 'indent=on'
, 'hl=true'
];
return params;
function getquerystring()
var form = document.forms['f1'];
var query = form.query.value;
qstr = 'q=' + escape(query);
return qstr;
// this function does all the work of parsing the solr response and updating the page.
function updatepage(str)
document.getElementById("raw").innerHTML = str;
var rsp = eval("("+str+")"); // use eval to parse Solr's JSON response
var html = "<br>numFound=" + rsp.response.numFound;
var first = rsp.response.docs[0];
html += "<br>product name=" + first.name;
var hl = rsp.highlighting[first.id];
if (hl.name != null) html += "<br>name highlighted: " + hl.name[0];
if (hl.features != null) html += "<br>features highligted: " + hl.features[0];
document.getElementById("result").innerHTML = html;
</script>
</head>
<body>
<form name="f1" onsubmit='xmlhttpPost("http://localhost:8983/solr/myCore/select?")'>
<p>query: <input name="query" type="text">
<input value="Go" type="submit"></p>
<div id="result"></div>
<p/><pre>Raw JSON String/output: <div id="raw"></div></pre>
</form>
</body>
</html>javascript json apache solr
1
Be aware that if you're opening this from a different server than the Solr server itself (same host:port), the request will be denied because of cross site requests being blocked by default.
– MatsLindh
Mar 22 at 7:47
I just have solr running on my laptop on the 8983 port, and on same computer opened up that html file in my firefox browser from which I can view the solr admin console.
– Caesium
Mar 22 at 18:39
That's probably not going to work, as a local opened file won't have access to read arbitrary content through javascript - it'll have to be opened from the samehost:portcombination as it should be read from, or the source being read has to present the approriate CORS headers.
– MatsLindh
Mar 22 at 18:42
How do I go about that? Pretty new to this whole port thing.
– Caesium
Mar 23 at 3:26
You'd probably want to stick a small web service in front of Solr instead of going directly from the browser. Security is usually also an issue, since Solr isn't meant to be stuck directly on the internet by default.
– MatsLindh
Mar 23 at 21:20
|
show 1 more comment
I am trying working off of https://wiki.apache.org/solr/SolJSON tutorial. I have put my url for solr in the code, copied from solr admin query result to make sure the query should return something.
I try typing in "title:Asian" into text box (that field/search term combo returned results in the admin console query) but when the button is hit, textbox just clears and nothing in output spot.
I used the dev tools from [F12] key of browser to check console and see there was no errors given there, such as for syntax, so not due to that.
Perhaps I am understanding how the url for query works or should be here? If I leave out local host part as shown I just get error for not specifying local full path.
Does anyone see anything wrong here, or have any ideas/tips of what more to do to try and solve the issue?
[ If I must do/add anything else to make good/better post here, please do explain so I can fix :) ]
<html>
<head>
<title>Solr Ajax Example</title>
<meta charset="UTF-8">
<script language="Javascript">
// derived from http://www.degraeve.com/reference/simple-ajax-example.php
function xmlhttpPost(strURL)
var xmlHttpReq = false;
var self = this;
if (window.XMLHttpRequest) // Mozilla/Safari
self.xmlHttpReq = new XMLHttpRequest();
else if (window.ActiveXObject) // IE
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
self.xmlHttpReq.open('POST', strURL, true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function()
if (self.xmlHttpReq.readyState == 4)
updatepage(self.xmlHttpReq.responseText);
;
var params = getstandardargs().concat(getquerystring());
var strData = params.join('&');
self.xmlHttpReq.send(strData);
//document.getElementById("raw").innerHTML = strData;
return false;
function getstandardargs()
var params = [
'wt=json'
, 'indent=on'
, 'hl=true'
];
return params;
function getquerystring()
var form = document.forms['f1'];
var query = form.query.value;
qstr = 'q=' + escape(query);
return qstr;
// this function does all the work of parsing the solr response and updating the page.
function updatepage(str)
document.getElementById("raw").innerHTML = str;
var rsp = eval("("+str+")"); // use eval to parse Solr's JSON response
var html = "<br>numFound=" + rsp.response.numFound;
var first = rsp.response.docs[0];
html += "<br>product name=" + first.name;
var hl = rsp.highlighting[first.id];
if (hl.name != null) html += "<br>name highlighted: " + hl.name[0];
if (hl.features != null) html += "<br>features highligted: " + hl.features[0];
document.getElementById("result").innerHTML = html;
</script>
</head>
<body>
<form name="f1" onsubmit='xmlhttpPost("http://localhost:8983/solr/myCore/select?")'>
<p>query: <input name="query" type="text">
<input value="Go" type="submit"></p>
<div id="result"></div>
<p/><pre>Raw JSON String/output: <div id="raw"></div></pre>
</form>
</body>
</html>javascript json apache solr
I am trying working off of https://wiki.apache.org/solr/SolJSON tutorial. I have put my url for solr in the code, copied from solr admin query result to make sure the query should return something.
I try typing in "title:Asian" into text box (that field/search term combo returned results in the admin console query) but when the button is hit, textbox just clears and nothing in output spot.
I used the dev tools from [F12] key of browser to check console and see there was no errors given there, such as for syntax, so not due to that.
Perhaps I am understanding how the url for query works or should be here? If I leave out local host part as shown I just get error for not specifying local full path.
Does anyone see anything wrong here, or have any ideas/tips of what more to do to try and solve the issue?
[ If I must do/add anything else to make good/better post here, please do explain so I can fix :) ]
<html>
<head>
<title>Solr Ajax Example</title>
<meta charset="UTF-8">
<script language="Javascript">
// derived from http://www.degraeve.com/reference/simple-ajax-example.php
function xmlhttpPost(strURL)
var xmlHttpReq = false;
var self = this;
if (window.XMLHttpRequest) // Mozilla/Safari
self.xmlHttpReq = new XMLHttpRequest();
else if (window.ActiveXObject) // IE
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
self.xmlHttpReq.open('POST', strURL, true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function()
if (self.xmlHttpReq.readyState == 4)
updatepage(self.xmlHttpReq.responseText);
;
var params = getstandardargs().concat(getquerystring());
var strData = params.join('&');
self.xmlHttpReq.send(strData);
//document.getElementById("raw").innerHTML = strData;
return false;
function getstandardargs()
var params = [
'wt=json'
, 'indent=on'
, 'hl=true'
];
return params;
function getquerystring()
var form = document.forms['f1'];
var query = form.query.value;
qstr = 'q=' + escape(query);
return qstr;
// this function does all the work of parsing the solr response and updating the page.
function updatepage(str)
document.getElementById("raw").innerHTML = str;
var rsp = eval("("+str+")"); // use eval to parse Solr's JSON response
var html = "<br>numFound=" + rsp.response.numFound;
var first = rsp.response.docs[0];
html += "<br>product name=" + first.name;
var hl = rsp.highlighting[first.id];
if (hl.name != null) html += "<br>name highlighted: " + hl.name[0];
if (hl.features != null) html += "<br>features highligted: " + hl.features[0];
document.getElementById("result").innerHTML = html;
</script>
</head>
<body>
<form name="f1" onsubmit='xmlhttpPost("http://localhost:8983/solr/myCore/select?")'>
<p>query: <input name="query" type="text">
<input value="Go" type="submit"></p>
<div id="result"></div>
<p/><pre>Raw JSON String/output: <div id="raw"></div></pre>
</form>
</body>
</html><html>
<head>
<title>Solr Ajax Example</title>
<meta charset="UTF-8">
<script language="Javascript">
// derived from http://www.degraeve.com/reference/simple-ajax-example.php
function xmlhttpPost(strURL)
var xmlHttpReq = false;
var self = this;
if (window.XMLHttpRequest) // Mozilla/Safari
self.xmlHttpReq = new XMLHttpRequest();
else if (window.ActiveXObject) // IE
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
self.xmlHttpReq.open('POST', strURL, true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function()
if (self.xmlHttpReq.readyState == 4)
updatepage(self.xmlHttpReq.responseText);
;
var params = getstandardargs().concat(getquerystring());
var strData = params.join('&');
self.xmlHttpReq.send(strData);
//document.getElementById("raw").innerHTML = strData;
return false;
function getstandardargs()
var params = [
'wt=json'
, 'indent=on'
, 'hl=true'
];
return params;
function getquerystring()
var form = document.forms['f1'];
var query = form.query.value;
qstr = 'q=' + escape(query);
return qstr;
// this function does all the work of parsing the solr response and updating the page.
function updatepage(str)
document.getElementById("raw").innerHTML = str;
var rsp = eval("("+str+")"); // use eval to parse Solr's JSON response
var html = "<br>numFound=" + rsp.response.numFound;
var first = rsp.response.docs[0];
html += "<br>product name=" + first.name;
var hl = rsp.highlighting[first.id];
if (hl.name != null) html += "<br>name highlighted: " + hl.name[0];
if (hl.features != null) html += "<br>features highligted: " + hl.features[0];
document.getElementById("result").innerHTML = html;
</script>
</head>
<body>
<form name="f1" onsubmit='xmlhttpPost("http://localhost:8983/solr/myCore/select?")'>
<p>query: <input name="query" type="text">
<input value="Go" type="submit"></p>
<div id="result"></div>
<p/><pre>Raw JSON String/output: <div id="raw"></div></pre>
</form>
</body>
</html><html>
<head>
<title>Solr Ajax Example</title>
<meta charset="UTF-8">
<script language="Javascript">
// derived from http://www.degraeve.com/reference/simple-ajax-example.php
function xmlhttpPost(strURL)
var xmlHttpReq = false;
var self = this;
if (window.XMLHttpRequest) // Mozilla/Safari
self.xmlHttpReq = new XMLHttpRequest();
else if (window.ActiveXObject) // IE
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
self.xmlHttpReq.open('POST', strURL, true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function()
if (self.xmlHttpReq.readyState == 4)
updatepage(self.xmlHttpReq.responseText);
;
var params = getstandardargs().concat(getquerystring());
var strData = params.join('&');
self.xmlHttpReq.send(strData);
//document.getElementById("raw").innerHTML = strData;
return false;
function getstandardargs()
var params = [
'wt=json'
, 'indent=on'
, 'hl=true'
];
return params;
function getquerystring()
var form = document.forms['f1'];
var query = form.query.value;
qstr = 'q=' + escape(query);
return qstr;
// this function does all the work of parsing the solr response and updating the page.
function updatepage(str)
document.getElementById("raw").innerHTML = str;
var rsp = eval("("+str+")"); // use eval to parse Solr's JSON response
var html = "<br>numFound=" + rsp.response.numFound;
var first = rsp.response.docs[0];
html += "<br>product name=" + first.name;
var hl = rsp.highlighting[first.id];
if (hl.name != null) html += "<br>name highlighted: " + hl.name[0];
if (hl.features != null) html += "<br>features highligted: " + hl.features[0];
document.getElementById("result").innerHTML = html;
</script>
</head>
<body>
<form name="f1" onsubmit='xmlhttpPost("http://localhost:8983/solr/myCore/select?")'>
<p>query: <input name="query" type="text">
<input value="Go" type="submit"></p>
<div id="result"></div>
<p/><pre>Raw JSON String/output: <div id="raw"></div></pre>
</form>
</body>
</html>javascript json apache solr
javascript json apache solr
edited Mar 22 at 0:36
Caesium
asked Mar 21 at 22:56
CaesiumCaesium
12
12
1
Be aware that if you're opening this from a different server than the Solr server itself (same host:port), the request will be denied because of cross site requests being blocked by default.
– MatsLindh
Mar 22 at 7:47
I just have solr running on my laptop on the 8983 port, and on same computer opened up that html file in my firefox browser from which I can view the solr admin console.
– Caesium
Mar 22 at 18:39
That's probably not going to work, as a local opened file won't have access to read arbitrary content through javascript - it'll have to be opened from the samehost:portcombination as it should be read from, or the source being read has to present the approriate CORS headers.
– MatsLindh
Mar 22 at 18:42
How do I go about that? Pretty new to this whole port thing.
– Caesium
Mar 23 at 3:26
You'd probably want to stick a small web service in front of Solr instead of going directly from the browser. Security is usually also an issue, since Solr isn't meant to be stuck directly on the internet by default.
– MatsLindh
Mar 23 at 21:20
|
show 1 more comment
1
Be aware that if you're opening this from a different server than the Solr server itself (same host:port), the request will be denied because of cross site requests being blocked by default.
– MatsLindh
Mar 22 at 7:47
I just have solr running on my laptop on the 8983 port, and on same computer opened up that html file in my firefox browser from which I can view the solr admin console.
– Caesium
Mar 22 at 18:39
That's probably not going to work, as a local opened file won't have access to read arbitrary content through javascript - it'll have to be opened from the samehost:portcombination as it should be read from, or the source being read has to present the approriate CORS headers.
– MatsLindh
Mar 22 at 18:42
How do I go about that? Pretty new to this whole port thing.
– Caesium
Mar 23 at 3:26
You'd probably want to stick a small web service in front of Solr instead of going directly from the browser. Security is usually also an issue, since Solr isn't meant to be stuck directly on the internet by default.
– MatsLindh
Mar 23 at 21:20
1
1
Be aware that if you're opening this from a different server than the Solr server itself (same host:port), the request will be denied because of cross site requests being blocked by default.
– MatsLindh
Mar 22 at 7:47
Be aware that if you're opening this from a different server than the Solr server itself (same host:port), the request will be denied because of cross site requests being blocked by default.
– MatsLindh
Mar 22 at 7:47
I just have solr running on my laptop on the 8983 port, and on same computer opened up that html file in my firefox browser from which I can view the solr admin console.
– Caesium
Mar 22 at 18:39
I just have solr running on my laptop on the 8983 port, and on same computer opened up that html file in my firefox browser from which I can view the solr admin console.
– Caesium
Mar 22 at 18:39
That's probably not going to work, as a local opened file won't have access to read arbitrary content through javascript - it'll have to be opened from the same
host:port combination as it should be read from, or the source being read has to present the approriate CORS headers.– MatsLindh
Mar 22 at 18:42
That's probably not going to work, as a local opened file won't have access to read arbitrary content through javascript - it'll have to be opened from the same
host:port combination as it should be read from, or the source being read has to present the approriate CORS headers.– MatsLindh
Mar 22 at 18:42
How do I go about that? Pretty new to this whole port thing.
– Caesium
Mar 23 at 3:26
How do I go about that? Pretty new to this whole port thing.
– Caesium
Mar 23 at 3:26
You'd probably want to stick a small web service in front of Solr instead of going directly from the browser. Security is usually also an issue, since Solr isn't meant to be stuck directly on the internet by default.
– MatsLindh
Mar 23 at 21:20
You'd probably want to stick a small web service in front of Solr instead of going directly from the browser. Security is usually also an issue, since Solr isn't meant to be stuck directly on the internet by default.
– MatsLindh
Mar 23 at 21:20
|
show 1 more comment
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290445%2ftrouble-querying-solr-from-javascript-and-displaying-results-getting-nothing%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290445%2ftrouble-querying-solr-from-javascript-and-displaying-results-getting-nothing%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Be aware that if you're opening this from a different server than the Solr server itself (same host:port), the request will be denied because of cross site requests being blocked by default.
– MatsLindh
Mar 22 at 7:47
I just have solr running on my laptop on the 8983 port, and on same computer opened up that html file in my firefox browser from which I can view the solr admin console.
– Caesium
Mar 22 at 18:39
That's probably not going to work, as a local opened file won't have access to read arbitrary content through javascript - it'll have to be opened from the same
host:portcombination as it should be read from, or the source being read has to present the approriate CORS headers.– MatsLindh
Mar 22 at 18:42
How do I go about that? Pretty new to this whole port thing.
– Caesium
Mar 23 at 3:26
You'd probably want to stick a small web service in front of Solr instead of going directly from the browser. Security is usually also an issue, since Solr isn't meant to be stuck directly on the internet by default.
– MatsLindh
Mar 23 at 21:20