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

not returning correct results #4

Open
prasad0405 opened this issue Mar 17, 2015 · 3 comments
Open

not returning correct results #4

prasad0405 opened this issue Mar 17, 2015 · 3 comments

Comments

@prasad0405
Copy link

Swagger UI method:
get /workorders/{id} Find a model instance by id from the data source

URL:

http://deveisvm3.dev.denverwater.org:2900/work/v1/workorders/15-111745

trace logs:

Elasticsearch DEBUG: 2015-03-17T18:26:25Z
starting request { method: 'POST',
path: '/work/WorkOrder/_search',
query:
{ where: { workOrderNumber: '15-111745' },
limit: 1,
offset: 0,
skip: 0 } }

Elasticsearch TRACE: 2015-03-17T18:26:25Z
-> POST http://devtsttibco02.denverwater.org:9200/work/WorkOrder/_search?where=&limit=1&offset=0&skip=0

The URL getting posted is not a valid one (where is empty below) and i don't see where as part of query/filter dsl in elastic search

http://devtsttibco02.denverwater.org:9200/work/WorkOrder/_search?where=&limit=1&offset=0&skip=0

@pulkitsinghal
Copy link

@prasad0405 - I need this module too ... so I am attempting to fix this stuff on my own, head over to the https://github.com/shoppinpal/loopback-connector-elastic-search fork and open an issue there? Afterwards I'll publish an alternative to NPM.

@pulkitsinghal
Copy link

@prasad0405 - if you look at the example in https://github.com/shoppinpal/loopback-connector-elastic-search ... you should see a way to setup your index mappings and the where clause should work properly, please confirm if it satisfies your use case after testing.

@pulkitsinghal
Copy link

@prasad0405 - also I was looking at the tests in @drakerian's implementation and its my guess that he/she favored the simplicity of using ES's DSL over all the conversions that would be involved if he used the loopback syntax: https://github.com/drakerian/loopback-connector-elastic-search/blob/master/test/filter-test.js#L25

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