Comments (16)
@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.
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.
@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.
Let me update the sample.
from solr-node-client.
@ranrao Updated most important examples in examples
directory as well as readme.
from solr-node-client.
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.
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.
Code sample would really help. Thanks so much for the prompt response.
from solr-node-client.
@ranrao Please let me know how it goes!
from solr-node-client.
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.
Can you confirm that solr is running and client url is configured correctly?
from solr-node-client.
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.
@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.
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.
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.
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)
- Migrate to TypeScript
- Using dynamic `require` instead of `import` in tests hides typescript errors. HOT 3
- Wrap requests in promises when callback is not set HOT 2
- Update migration guide
- Replace callback-based API with promise-based async functions HOT 37
- Build Issue: 0.10.0-RC8 HOT 10
- Firefox: Uncaught TypeError: Error.captureStackTrace is not a function HOT 1
- Question: TypeScript Declaration HOT 2
- Requesting an example to add options like SSL parameters (like ca, cert, key). HOT 4
- Undici library causes tests to fail in the browser (Karma).
- Do not require a port when making a connection HOT 5
- Update function fails: "msg":"Unknown command 'id' at [5]" HOT 1
- Uncaught exception when client.ping is called against unresponsive Solr instance
- { library: 'SSL routines', function: 'ssl3_get_record', reason: 'wrong version number', code: 'ERR_SSL_WRONG_VERSION_NUMBER' } Error HOT 1
- Ability to add other parameters like `debug` or `rows` HOT 1
- Support for Solr 9? HOT 3
- TS Export Errors HOT 1
- Any way to mitigate specific errors caused by some field ?
- Facing issue while connecting `solr-client` with Zookeeper for Solr-Cloud
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solr-node-client.