Giter Club home page Giter Club logo

Comments (16)

kibertoad avatar kibertoad commented on July 22, 2024 2

@ranrao Do you use Docker? This is how we init Solr Docker image:

services:
  solr:
    container_name: solr_dev
    image: solr:8.9.0
    ports:
      - "8983:8983"
    networks:
      - proxynet
    volumes:
      - data:/root/solr
      - /root/solr:/opt/solr-8.9.0/customSettings
    entrypoint:
      - bash
      - "-c"
      - "precreate-core testcore; precreate-core vehicles; precreate-core users /opt/solr-8.9.0/customSettings/users; precreate-core organizations; precreate-core classifiers; precreate-core departments; precreate-core roles; exec solr -f"
    hostname: solr_hostname

Alternatively see this: https://www.tutorialspoint.com/apache_solr/apache_solr_core.htm

from solr-node-client.

kibertoad avatar kibertoad commented on July 22, 2024 1

I would strongly recommend giving latest RC version a try. It uses a much friendlier promise API that should be easier to consume. Main reason why it's not final yet is because we still need to update documentation, but it should be pretty stable and ready for production (and actually significantly more performant than the current stable version).

from solr-node-client.

kibertoad avatar kibertoad commented on July 22, 2024 1

@ranrao Ah, that explains it. You are trying using it with callback API which is no longer supported. Remove the callback parameter and just await this call.

from solr-node-client.

kibertoad avatar kibertoad commented on July 22, 2024 1

Let me update the sample.

from solr-node-client.

kibertoad avatar kibertoad commented on July 22, 2024 1

@ranrao Updated most important examples in examples directory as well as readme.

from solr-node-client.

ranrao avatar ranrao commented on July 22, 2024 1

Thank you @kibertoad. Tried creating a Solr core and it is all working very well now. Such timely help. Really appreciate it.

from solr-node-client.

ranrao avatar ranrao commented on July 22, 2024

Thank you @kibertoad. I'm using "solr-client": "^0.10.0-rc8",, should we try another version?

Or should I change anything in the sample code?

Appreciate any leads to overcome the error. Thank you

from solr-node-client.

ranrao avatar ranrao commented on July 22, 2024

Code sample would really help. Thanks so much for the prompt response.

from solr-node-client.

kibertoad avatar kibertoad commented on July 22, 2024

@ranrao Please let me know how it goes!

from solr-node-client.

ranrao avatar ranrao commented on July 22, 2024

Thank you @kibertoad. Still seeing this error:

Error: Request HTTP error 404:
at Client.doRequest (.../node_modules/solr-client/dist/lib/solr.js:141:19)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async index (/..../index.js:36:21)

My line 36 is const obj = await client.add([item]);

try {
        const obj = await client.add([item]);
        console.log(obj);
    } catch (e) {
        console.log(e);
    }

Any idea why 404 error?

from solr-node-client.

kibertoad avatar kibertoad commented on July 22, 2024

Can you confirm that solr is running and client url is configured correctly?

from solr-node-client.

ranrao avatar ranrao commented on July 22, 2024

brew services start solr
==> Successfully started solr (label: homebrew.mxcl.solr)

In terms of client url, this is the initial code:

const solr = require('solr-client');
const client = solr.createClient();

Trying this simple command also fails.

try {
        const obj = await client.add({ id: 12, title_t: 'Hello' });
        console.log(obj);
    } catch (e) {
        console.log(e);
    }

Am I missing anything in setup? Kindly update.

from solr-node-client.

kibertoad avatar kibertoad commented on July 22, 2024

@ranrao Default host is 127.0.0.1, default path is /solr', default port is 8983. Check if you can access SolrUI (admin panel) using such values; if not, pass correct version of these parameters to createClient

from solr-node-client.

kibertoad avatar kibertoad commented on July 22, 2024

Ah, another reason might be that you are using non-existing Solr core. Default is an empty one, you probably want to create and use a specific one.

from solr-node-client.

ranrao avatar ranrao commented on July 22, 2024

Sure, thanks @kibertoad. Will create a Solr core and try again.

Any documentation that helps in creating a simple Solr core? We are switching from Elastic Search to Solr, and hence the learning curve. Thanks so much.

from solr-node-client.

kibertoad avatar kibertoad commented on July 22, 2024

You are welcome! Please don't be a stranger and let us know if you'll need any help in the future.

from solr-node-client.

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.