react-complete-me
react-complete-me copied to clipboard
Where to start?
Hi,
This is not really an issue. More like a request for information :)
I am a newbie to React and Elastic Search. I followed the steps in ElasticSearch's You Complete Me post and created the Hotels data. Then, I cloned this repo and updated the API Endpoint to my localhost. Then, I performed npm install and bower install. Everything went well. But, now I am lost.
I couldn't find any file with node server code. What's the next step?
.Uday
I did try creating my own node server and served the file. But, I am getting a js error: Uncaught TypeError: this._suggestions.filter is not a functione.createClass._filter_suggestions @ suggestion-list.js:79H._bindAutoBindMethod.n @ react-with-addons.js:6441e.createClass.set_suggestions @ suggestion-list.js:34H._bindAutoBindMethod.n @ react-with-addons.js:6441(anonymous function) @ suggestion-list.js:92(anonymous function) @ suggestion.js:85e.register.h.callback @ superagent.js:1178(anonymous function) @ superagent.js:851e.register.o.emit @ superagent.js:337e.register.h.end.n.onreadystatechange @ superagent.js:1250
Not sure what I am doing wrong....
Hey Uday,
I've had plans to flesh out this example a little more with an example bridge sever running on Node. I just haven't gotten around to it. I obviously use this in one of my projects. I'll see how long it would take to throw something useful together and see if I'll have time to do that any time soon.
To answer your question, this._suggestions
should be populated with an array provided that your
_ELASTICSEARCH_ENDPOINT
returns data in the proper format. The error you are getting is a result of this._suggestions
not being an array--the function filter
is not defined on it.
So my guess is that you're not returning <your_type_here>.options
. But, I don't have time to investigate this any farther.
Anyway, hope to have an example for you up soon. It's been on my TODO list for a while, and now I have a reason.
Hope this has been helpful for you.
Cheers,
Hi,
Thanks for responding :)
After seeing your response and going through the readme once again, I understand that I need to write a 'BRIDGE' that will get the parameters passed through the _ELASTICSEARCH_ENDPOINT as query parameters and use that to form a POST object and send it to the elastic search API.
Is this a correct understanding?
I understand that you are busy. But, I am pretty much stuck here and have been since yesterday. I also couldn't figure out where the list of values are coming from for the select box. Is there any way you can just list out the steps I need to follow to get this working. If I get this working, I'd be happy to write out a detailed example with steps for the readme.