Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Luke Wendling
    @lukewendling
    @pulkitsinghal haven't looked at this project in awhile, but is there native support for ES scrolling?
    Pulkit Singhal
    @pulkitsinghal

    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
    @pulkitsinghal
    ... ok now i'm sure i did not use scrolling for search results
    Aquid Shahwar
    @aquid
    v1.3.2 of elasticsearch connector was released today Jan 31, 2017
    https://www.npmjs.com/package/loopback-connector-es
    Thomas Chille
    @thochi

    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:

    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
    Thomas

    Pulkit Singhal
    @pulkitsinghal
    @thochi - I would like to explain, can you schedule a time slot with me on calendly.com/pulkitsinghal ?
    Thomas Chille
    @thochi
    @pulkitsinghal great, i scheduled one. thanks
    Pulkit Singhal
    @pulkitsinghal
    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
    Samriddhi
    @samriddhi
    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",
            "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"
              ]
            }
          }
        }
      }
    Pulkit Singhal
    @pulkitsinghal
    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
    Samriddhi
    @samriddhi
    yeah i got it to work with /index/_close
    and then importing the settings then opening the index
    Pulkit Singhal
    @pulkitsinghal
    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?
    Samriddhi
    @samriddhi
    okay I will thank you
    Pulkit Singhal
    @pulkitsinghal
    @/all version 1.4.0 of elasticsearch connector has been released
    it supports v5.x of es
    nejczupan
    @nejczupan

    @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?

    Pulkit Singhal
    @pulkitsinghal
    @nejczupan - my brain isn't working right now, i hope someone else from this community can help
    Muhammad Ahsan Ayaz
    @AhsanAyaz
    Hey guys (especially the admins)
    Whenever you get a chance, please review the PR.
    strongloop-community/loopback-connector-elastic-search#99
    Alejandro
    @Alejandro_ST_17_twitter
    Hi! One question: it's possible to make ELS aggregations using this connector? Thanks so much.
    Pulkit Singhal
    @pulkitsinghal
    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
    HarenderDudi
    @HarenderDudi
    hi, can anyone help me with how to get elasticsearch document lock using java
    Steven
    @onstrike07
    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.
    image.png
    Pulkit Singhal
    @pulkitsinghal
    @HarenderDudi - i cannot help with this topic ... maybe you might find more help on an ES + java forum? i hope someone here who knows responds too :)
    Shundan Xiao
    @sherryxiao1988
    do we support elastic search 5.x yet?
    Steven
    @onstrike07
    I don't have an official answer. I made a quick test on ES 5.4 and it seems work. I just did a query and the connector could return expected results. Haven't tested more yet.
    Shundan Xiao
    @sherryxiao1988
    thanks! @onstrike07 worked for me too. i put 5.x in apiVersion
    another question, I am trying to test the GET call, what should I put in filter? my query string wasn't built correctly no matter what I put there.
    {"body": {"query": {"match": {"title": "Futuro"}}}}
    {"q" : "Futuro"}
    ^ neither of them works
    Steven
    @onstrike07
    if you are testing it from Explorer, try {"where": {"title":"Futuro"}}, if you are calling the api from javascript, you need to use "filter" to enclose it, like {"filter": {"where": {"title": "Futuro"}}}
    Steven
    @onstrike07
    I connected the connector to a username and password protected ES 5.5 instance. I got error, as listed below, when I did a query.
    Steven
    @onstrike07

    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/

    Here is the datasource:
    "eventlog": {
    "name": "eventlog",
    "connector": "es",
    "index": "alive-time-nginx-access",
    "hosts": [
    {
    "host": "username:passoword@10.10.10.10",
    "port": 9200
    }
    ],
    "apiVersion": "5.0",
    "log": "trace",
    "defaultSize": 50,
    "requestTimeout": 30000
    }
    Pulkit Singhal
    @pulkitsinghal
    Thanks for helping others Steven, I’ll try to find an engineer in my team to ramp up on ES connector to help out by end of this week.
    If I can find someone who is bored with plain office work and wants some open source excitement to go along with it then it’ll be a win-win
    Steven
    @onstrike07
    Thanks boss!
    Steven
    @onstrike07
    I fixed this issue by modifying the "hosts" part in datasource.json, as shown below,
    Vladimir Sazonov
    @sazik-rzn
    hi friends! how make query like mysql's "WHERE id IN (1,2,3,4,5,...)"?
    Leonardo Alvarez
    @leoalvarez81

    Hi there, Could someone help me?
    How can I make Create or Update requests? Something like

    POST /my-index/my-type/<id>
    {
      "body": "foo"
    }

    When I use the loopback model API PUT /MyModel/<id>, I get an error

    {
      "error": {
        "statusCode": 500,
        "name": "Error",
        "message": "The connector elasticsearch does not support replaceById operation. This is not a bug in LoopBack. Please contact the authors of the connector, preferably via GitHub issues.",
     ...
    }
    Leonardo Alvarez
    @leoalvarez81
    Also, I would prefer not to do the 2 steps: checking if exists with GET, then use the PATCH API.
    Pulkit Singhal
    @pulkitsinghal
    Is there a mixin for reset password? Or rather is it possible to implement reset password via a mixin approach?
    caiyufei
    @caiyufei
    We plan to connect elasticsearch in loopback framework , but https://github.com/strongloop-community/loopback-connector-elastic-search has NOT been updated since June 2017 , Will it be deprecated ?