Strongloop Loopback connector for Elasticsearch
I'm new to elasticsearch and the loopback connector. I've downloaded the sample and followed the instructions https://github.com/strongloop-community/loopback-connector-elastic-search
. Guidance suggests to use localhost:3000/explorer
once setup complete. It seems all the operations in the explorer respond with an error. Any suggestions?
"name": "Error",
"status": 401,
"message": "Authorization Required"
re-reading what i typed, it sounds defensive of me but that wasn't my intention ... please read the following for the content and not the tone :)
@lukewendling - not sure what native support for scrolling means from person to person ... for example, the underlying client is provided by ES so yes there is native support for scrolling because that client has it ... but if that means: Is scrolling used to deliver/manage any and all results everywhere by the ESConnector as a best practice? then no! Some amount of thought would be required to identify the places in code where it makes sense ... as simple as it might seem to others, sharing usecases with me helps me do better.
Now I did use scrolling for deletion ... if you happen to be using 2.x as your ES ... you can find more about the usecase that was shared with me and how i went down that rabbit hole to come up with a solution here: strongloop-community/loopback-connector-elastic-search#45
Maybe the commits from there can inspire a solution or a request for enhancement?
Hi,
we are developing a profile database for medical experts and i'm in the process of figuring out if the es-connector is suitable for our setup.
We already have a loopback api backed by a mongodb. In this db we are storing profiles consisting of different model documents and their relations.
Now we wanne make the profiles together w/ some computed values accessible via eleasticsearch. Our approach is to generate single profile documents w/ all searchable fields, including the computed ones and put them initially and on update via rest calls into elasticsearch.
We want to use elasticsearch because of speed, the highlighting support and relevance search.
Now my questions are:
Thanks a lot
Thomas
"mappings": [
{
"name": "contactsearch",
"index": "hero-search",
"type":"contact",
"properties": {
"name": {"type": "string"},
"skills": {"type": "string"},
"categories":{"type": "string"},
"categoryIds":{"type": "string"},
"email": {"type": "string", "analyzer": "email"},
"phone": {"type": "string"}
}
}],
"settings": {
"analysis": {
"filter": {
"email": {
"type": "pattern_capture",
"preserve_original": 1,
"patterns": [
"([^@]+)",
"(\\p{L}+)",
"(\\d+)",
"@(.+)",
"([^-@]+)"
]
}
},
"analyzer": {
"email": {
"tokenizer": "uax_url_email",
"filter": [
"email",
"lowercase",
"unique"
]
}
}
}
}
@nejczupan
hey guys, I have a quick question.
I have daily indices.
I am reindexing and I would like to have a simple template which creates indicies with setting I like.
Then I use static mapping with dynamic strict.
The problem is that the next day (due to daily indices) my static mapping is not being used but rather it uses default template without static mapping used previous day.
What would be my solution?
so i would have to say:
no @Alejandro_ST_17_twitter its not possible to perform ELS aggregations using this connector
there is no good out-of-the-box support for this ... its not impossible with some thought and vision but i cannot imagine what method name i should expose such support under and what all might be useful for different folks :(
filter
? my query string wasn't built correctly no matter what I put there.
Elasticsearch DEBUG: 2017-10-11T02:51:52Z
starting request {
"method": "POST",
"path": "/alive-time-nginx-access/events/_search",
"body": {
"query": {
"match_all": {}
}
},
"query": {
"size": 50
}
}
Elasticsearch TRACE: 2017-10-11T02:51:52Z
-> POST http://[username:password2217@10.10.10.10]:9200/alive-time-nginx-access/events/_search?size=50
{
"query": {
"match_all": {}
}
}
<- 0
Elasticsearch ERROR: 2017-10-11T02:51:52Z
Error: Request error, retrying
POST http://username:password@10.10.10.10:9200/alive-time-nginx-access/events/_search?size=50 => getaddrinfo EAI_FAIL username:password@10.10.10.10:9200
at Log.error (E:\Dropbox\Dropbox\Programming\password\api\node_modules\loopback-connector-es\node_modules\elasticsearch\src\lib\log.js:225:56)
at checkRespForFailure (E:\Dropbox\Dropbox\Programming\password\api\node_modules\loopback-connector-es\node_modules\elasticsearch\src\lib\transport.js:240:18)
at HttpConnector.<anonymous> (E:\Dropbox\Dropbox\Programming\password\api\node_modules\loopback-connector-es\node_modules\elasticsearch\src\lib\connectors\http.js:1
62:7)
at ClientRequest.wrapper (E:\Dropbox\Dropbox\Programming\password\api\node_modules\loopback-connector-es\node_modules\elasticsearch\node_modules\lodash\lodash.js:49
68:19)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at Socket.socketErrorListener (_http_client.js:310:9)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at connectErrorNT (net.js:1022:8)
at E:\Dropbox\Dropbox\Programming\password\api\node_modules\loopback\node_modules\loopback-context\node_modules\continuation-local-storage\node_modules\async-listen
er\glue.js:188:31
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:122:9)
Elasticsearch TRACE: 2017-10-11T02:51:52Z
-> HEAD http://[username:password@10.10.10.10]:9200/
<- 0
Elasticsearch WARNING: 2017-10-11T02:51:52Z
Unable to revive connection: http://username:password@10.10.10.10:9200/
Elasticsearch WARNING: 2017-10-11T02:51:52Z
No living connections
Trace: No Living connections
at E:\Dropbox\Dropbox\Programming\password\api\node_modules\loopback-connector-es\lib\esConnector.js:874:19
at tryCallOne (E:\Dropbox\Dropbox\Programming\password\api\node_modules\loopback-connector-es\node_modules\elasticsearch\node_modules\promise\lib\core.js:37:12)
at E:\Dropbox\Dropbox\Programming\password\api\node_modules\loopback-connector-es\node_modules\elasticsearch\node_modules\promise\lib\core.js:123:15
at flush (E:\Dropbox\Dropbox\Programming\password\api\node_modules\loopback-connector-es\node_modules\elasticsearch\node_modules\promise\node_modules\asap\raw.js:50:2
9)
at E:\Dropbox\Dropbox\Programming\password\api\node_modules\loopback\node_modules\loopback-context\node_modules\continuation-local-storage\node_modules\async-listener
\glue.js:188:31
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:122:9)
Elasticsearch TRACE: 2017-10-11T02:53:17Z
-> HEAD http://[username:password@10.10.10.10]:9200/