Git Product home page Git Product logo

Comments (13)

jpmckinney avatar jpmckinney commented on July 25, 2024

You'll have to provide more information. Works fine at http://evolvingweb.github.io/ajax-solr/examples/reuters/index.html and works locally for me.

from ajax-solr.

reviliant avatar reviliant commented on July 25, 2024

Hello, my bad......: ) Thanks anyways....now the reuters data is coming up.....bumped into another issue...
replaced the reuter's URL with my localhost SOLR server URL - unfortunately it ain't fetching anything....Suggestions?
The SOLR URL is working perfectly fine .

from ajax-solr.

jpmckinney avatar jpmckinney commented on July 25, 2024

What URL did you put into ajax-solr?

from ajax-solr.

reviliant avatar reviliant commented on July 25, 2024

http://localhost:8983/solr/ as has been mentioned in the tutorial

from ajax-solr.

jpmckinney avatar jpmckinney commented on July 25, 2024

Does visiting that URL redirect anywhere, or does it just load the Solr interface?

from ajax-solr.

jpmckinney avatar jpmckinney commented on July 25, 2024

It's probably that your data doesn't match the schema of the Reuters Solr instance. Opening index.html won't instantly work with your Solr instance. You need to follow the tutorial step-by-step and make changes as necessary, making sure it works at every step.

from ajax-solr.

reviliant avatar reviliant commented on July 25, 2024

Ok...the reuters page is working anyways - it was my bad.

So let me follow the entire tutorial and get back in case of any issues. Thanks for being prompt in your response.

from ajax-solr.

reviliant avatar reviliant commented on July 25, 2024

Hello,
I am at Step 2 (Add a results widget). Below is the extract of my json

"docs": [
{
"a_name": "data1",
"a_desc": "data1",
"quarter": "data1",
"year": "data1",
"id": "data1",
"crea_by": "data1",
"actv_name": "data1",
"day": "data1",
"app_name": "data1",
"module": "data1",
"month": "data1",
"version": data1
},
{}]

which is coming properly from SOLR.

Below is the extract from ResultWidget.js

afterRequest: function () {
$(this.target).empty();
for (var i = 0, l = this.manager.response.response.docs.length; i < l; i++) {
var doc = this.manager.response.response.docs[i];
$(this.target).append(this.template(doc));
var items = [];
items = items.concat(this.facetLinks('topics', doc.app_name));
items = items.concat(this.facetLinks('organisations', doc.module));
items = items.concat(this.facetLinks('exchanges', doc.month));

  var $links = $('#links_' + doc.id);
  $links.empty();
  for (var j = 0, m = items.length; j < m; j++) {
    $links.append($('<li></li>').append(items[j]));
  }
}

},

template: function (doc) {
var snippet = '';
if (doc.a_name.length > 300) {
snippet += doc.month + ' ' + doc.a_name.substring(0, 300);
snippet += '' + doc.a_name.substring(300);
snippet += '
more';
}
else {
snippet += doc.month + ' ' + doc.a_name;
}

var output = '<div><h2>' + doc.a_desc + '</h2>';
output += '<p id="links_' + doc.id + '" class="links"></p>';
output += '<p>' + snippet + '</p></div>';
return output;

},

I have the appropriate changes.

Still the data is not being shown from my SOLR instance. Please advise.

from ajax-solr.

jpmckinney avatar jpmckinney commented on July 25, 2024

The first parameter to facetLinks doesn’t look correct. It should match the field name.

On Nov 24, 2014, at 4:05 PM, reviliant [email protected] wrote:

Hello,
I am on Step 2 (Add a results widget). Below are the extract of my json

"docs": [
{
"a_name": "data1",
"a_desc": "data1",
"quarter": "data1",
"year": "data1",
"id": "data1",
"crea_by": "data1",
"actv_name": "data1",
"day": "data1",
"app_name": "data1",
"module": "data1",
"month": "data1",
"version": data1
},
{}]

which is coming properly from SOLR.

Below is the extract from ResultWidget.js

afterRequest: function () {
$(this.target).empty();
for (var i = 0, l = this.manager.response.response.docs.length; i < l; i++) {
var doc = this.manager.response.response.docs[i];
$(this.target).append(this.template(doc));
var items = [];
items = items.concat(this.facetLinks('topics', doc.app_name));
items = items.concat(this.facetLinks('organisations', doc.module));
items = items.concat(this.facetLinks('exchanges', doc.month));

var $links = $('#links_' + doc.id);
$links.empty();
for (var j = 0, m = items.length; j < m; j++) {
$links.append($('

  • ').append(items[j]));
    }
    }
    },

    template: function (doc) {
    var snippet = '';
    if (doc.a_name.length > 300) {
    snippet += doc.month + ' ' + doc.a_name.substring(0, 300);
    snippet += '' + doc.a_name.substring(300);
    snippet += ' more';
    }
    else {
    snippet += doc.month + ' ' + doc.a_name;
    }

    var output = '

    ' + doc.a_desc + '

    ';
    output += '';
    output += '

    ' + snippet + '

    ';
    return output;
    },

    I have the appropriate changes.

    Still the data is not being shown from my SOLR instance. Please advise.


    Reply to this email directly or view it on GitHub.

    from ajax-solr.

    reviliant avatar reviliant commented on July 25, 2024

    Do you mean

    items = items.concat(this.facetLinks('app_name', doc.app_name));

    Got you....

    from ajax-solr.

    reviliant avatar reviliant commented on July 25, 2024

    Edited in reuters.js, index.html as well as ResultWidget.js but no luck!

    from ajax-solr.

    jpmckinney avatar jpmckinney commented on July 25, 2024

    Did you check your JavaScript console for errors? Chrome, Firefox, and Safari have good JS error consoles.

    from ajax-solr.

    reviliant avatar reviliant commented on July 25, 2024

    Hello James, Yeah was doing that right now...will keep you posted...I thought it will be straight forward, but it seems like some work :).
    Anyways thanks for the help..Will keep you posted about how it goes!

    from ajax-solr.

    Related Issues (20)

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google ❤️ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.