Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Pulkit Singhal
    hello @yagobski ... i imagine that the same problem would exist no matter which connector is used
    there are alternatives to getCurrentContext discussed here: strongloop/loopback#1495
    but its a really long discusssion
    i recommend using a loopback version below 2.29.0 and using the npm-shrinkwrap.json file from a previous working deployment to help make sure that context+CLS continue to behave predictably and don't fail all of a sudden because of unfrozen dependency or sub-sub-sub dependency changes
    Pulkit Singhal
    even if you choose 2.29.0 and above ... deprecated doesn't mean it won't work, it just means you have to make it work yourself and when it does, freeze it properly with shrinkwrap and loopback folks won't help much
    you can also discuss more freely in the https://gitter.im/strongloop/loopback room

    for your benefit here is cutout from my own research (again nothing to do with ES connector):

    With that in mind, what's Loopback's plan here? This seems like a major pain point for the framework. The Loopback Context is currently dangerously unreliable, and moving away from CLS would be a huge undertaking. However, not having a good way to pass state becomes a huge problem at times. We can explicitly pass things via options in a lot of cases, but it's not universal and it doesn't cover built-ins.
    What's the plan?

    and i hope people in thehttps://gitter.im/strongloop/loopback room will give you better answers than me
    thanks guys for your help
    Pulkit Singhal
    No problem, @yagobski ... Wish I had something more concrete to share
    Ryan Gilbert
    hey, does anyone know if the community connector for elastic search supports referencesMany inclusion? the related models are mapped correctly, but FKs never get replaced with their models
    Pulkit Singhal
    @Imryangilbert_twitter - it doesn't ... that feature has to be added
    Ryan Gilbert
    @pulkitsinghal thanks for clarifying and additionally, all your work on the connector. although I remember reading one of your comments somewhere implying that inclusion could still work in connection with another datasource because it's passed off to the juggler. also, is it possible to get the _score from each search through the built-in methods?
    Pulkit Singhal
    Hey Ryan, I'm a mess. I reload my brain every 2 months with the right context and then I don't find the time to implement and then I do a poor job of answering questions here :worried:
    What I meant to say is that I also hoped that I wouldn't have to do anything special for related models
    And that juggler would handle it
    But if something isn't working and it requires code on the connector side then it's safe to assume that either I or other contributors haven't written it yet
    Look in tests for the native query ... I am not sure if that means that score will come across, just that we can search in ES DSL ... I could be wrong ... Other comments by folks can be useful
    Ryan Gilbert
    Haha, thank you. Currently using native search without seeing _score, but the model may have suppressed it without a property.

    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"

    Luke Wendling
    @mkdavis for loopback 2.x, there are several ways to disable auth, but one is to look at server/boot/authentication.js.
    @pulkitsinghal haven't looked at this project in awhile, but is there native support for ES scrolling?
    Pulkit Singhal

    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?

    Pulkit Singhal
    ... ok now i'm sure i did not use scrolling for search results
    Aquid Shahwar
    v1.3.2 of elasticsearch connector was released today Jan 31, 2017
    Thomas Chille


    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:

    1. What can be the purpose of the es-connector in this setup? An unified api?
    2. Do we have then to use the loopback query syntax or the elasticsearch query syntax?
    3. Can we still use highlighting and relevance search?

    Thanks a lot

    Pulkit Singhal
    @thochi - I would like to explain, can you schedule a time slot with me on calendly.com/pulkitsinghal ?
    Thomas Chille
    @pulkitsinghal great, i scheduled one. thanks
    Pulkit Singhal
    https://github.com/ShoppinPal/elastic-mongo is worth a try if you will perform out-of-band sync between your one source of truth and ES
    Hi ,
    I am trying to add an analyzer that you have in your documents for email but I keep getting an error about the analyzer not being found. Is there another place the analyzer needs to be referenced or documentation on it
      "mappings": [
            "name": "contactsearch",
            "index": "hero-search",
            "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": [
          "analyzer": {
            "email": {
              "tokenizer": "uax_url_email",
              "filter": [
    Pulkit Singhal
    almost sounds like the index already exists and therefore the code doesn't create it with the analyzer in it
    try deleting the index and then running the code
    yeah i got it to work with /index/_close
    and then importing the settings then opening the index
    Pulkit Singhal
    It would be great if connector took care of such things rather than doing so manually, just as a convenience of nothing else ... How about you file an issue for this and we'll work on it?
    okay I will thank you
    Pulkit Singhal
    @/all version 1.4.0 of elasticsearch connector has been released
    it supports v5.x of es

    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?

    Pulkit Singhal
    @nejczupan - my brain isn't working right now, i hope someone else from this community can help
    Muhammad Ahsan Ayaz
    Hey guys (especially the admins)
    Whenever you get a chance, please review the PR.
    Hi! One question: it's possible to make ELS aggregations using this connector? Thanks so much.
    Pulkit Singhal
    you could make any sort of request using native keyword but massaging the result you get back to give you aggregations is tricky and has not been through or implemented

    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 :(

    if you want to mess around and submit a PR, i would welcome it
    hi, can anyone help me with how to get elasticsearch document lock using java
    I did some aggregations by a kind of hard-coding way. I passed a parameter like 'aggtype' to the connector, and check this parameter in ESConnector.prototype.all function. If this parameter is provided, then do your aggregation queries and return result. If not, just do regular query.