Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Nothing #1

Open
kevinjuliano1020 opened this issue Nov 13, 2018 · 5 comments
Open

Getting Nothing #1

kevinjuliano1020 opened this issue Nov 13, 2018 · 5 comments

Comments

@kevinjuliano1020
Copy link

kevinjuliano1020 commented Nov 13, 2018

I am not getting any response. even errors. here's my code:

const Sphinx = require('sphinx-promise');
const sphinx = new Sphinx({
	host: 'localhost', // default sphinx host
	port: 9300 // default sphinx TCP port
});

let query = 'word | anotherword';

sphinx.query(query).then(result => {
	console.log(result);
}).catch(console.error.bind(console));
@IPRIT
Copy link
Owner

IPRIT commented Nov 13, 2018

@kevinjuliano1020 Did you set up your Database for work with Sphinx?

@kevinjuliano1020
Copy link
Author

I am actually using a tunnel from my server. when I change the port or the host I am getting a connection error. but if I put the right param it is returning nothing.

@kevinjuliano1020
Copy link
Author

you can check this screenshot https://ibb.co/mMmu20

@IPRIT
Copy link
Owner

IPRIT commented Nov 13, 2018

@kevinjuliano1020 Please run that code with a little changes:

sphinx.query(query).then(result => {
	console.log('result:', result);
}).catch(console.error.bind(console));

If result is "result: " then you didn't find anything with that query.
Or probably u need to wait while connection will be established. So you can simply wrap your query above into setTimeout for a 1-2 seconds to test it.

@kevinjuliano1020
Copy link
Author

kevinjuliano1020 commented Nov 13, 2018

No luck, I actually set it to 20secs
setTimeout(function(){ sphinx.query(query).then(result => { console.log("test"); console.log('result:', result); }).catch(console.error.bind(console)); }, 20000);
https://ibb.co/egTcpf
https://ibb.co/gSrGFL
also I added additional log to test. but it is not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants