elastic_client icon indicating copy to clipboard operation
elastic_client copied to clipboard

example does not work

Open silverfox983 opened this issue 6 years ago • 5 comments

Same as the example final rs = await client.search( 'my_index', 'my_type', elastic.Query.term('some', ['data']));

and the traceback Unhandled exception: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'int' in type cast #0 Client.search (package:elastic_client/src/elastic_client_impl.dart:123:46) <asynchronous suspension> #1 main (package:dartcli/dartcli.dart:12:27) <asynchronous suspension> #2 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:300:19) #3 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:171:12)

silverfox983 avatar Jun 27 '19 01:06 silverfox983

@silverfox983 please include the stacktrace and what you are calling.

isoos avatar Jun 27 '19 04:06 isoos

I get this error when I try to use the "indexExists()" or the "search()" function. Could it be because my ConsolHttpTransport data might be wrong? I am testing the example code on pub.dev and it is not working.

Error Exception has occurred. NoSuchMethodError (NoSuchMethodError: The getter 'keys' was called on null. Receiver: null Tried calling: keys)

Kickbykick avatar Sep 01 '20 06:09 Kickbykick

@Kickbykick: could you please include the full stacktrace?

isoos avatar Sep 01 '20 06:09 isoos

Does this help?

Object.noSuchMethod (dart:core-patch/object_patch.dart:51) MapMixin.addAll (dart:collection/maps.dart:128) HttpTransport._mergeHeader (c:\flutter_windows_v1.12.13+hotfix.5-stable\flutter.pub-cache\hosted\pub.dartlang.org\elastic_client-0.1.13\lib\src\http_transport.dart:47) HttpTransport.send (c:\flutter_windows_v1.12.13+hotfix.5-stable\flutter.pub-cache\hosted\pub.dartlang.org\elastic_client-0.1.13\lib\src\http_transport.dart:32) Client.flushIndex (c:\flutter_windows_v1.12.13+hotfix.5-stable\flutter.pub-cache\hosted\pub.dartlang.org\elastic_client-0.1.13\lib\src\elastic_client_impl.dart:45) _MyHomePageState.main (c:\Users\Kiibati\Desktop\Projects Flut\elasticsearch\lib\main.dart:59) (Unknown Source:0) _MyHomePageState.build. (c:\Users\Kiibati\Desktop\Projects Flut\elasticsearch\lib\main.dart:111) _Closure.call (dart:core-patch/function.dart:0) _InkResponseState._handleTap (c:\flutter_windows_v1.12.13+hotfix.5-stable\flutter\packages\flutter\lib\src\material\ink_well.dart:992) _InkResponseState.build. (c:\flutter_windows_v1.12.13+hotfix.5-stable\flutter\packages\flutter\lib\src\material\ink_well.dart:1098) _Closure.call (dart:core-patch/function.dart:0) GestureRecognizer.invokeCallback (c:\flutter_windows_v1.12.13+hotfix.5-stable\flutter\packages\flutter\lib\src\gestures\recognizer.dart:184) TapGestureRecognizer.handleTapUp (c:\flutter_windows_v1.12.13+hotfix.5-stable\flutter\packages\flutter\lib\src\gestures\tap.dart:524) BaseTapGestureRecognizer._checkUp (c:\flutter_windows_v1.12.13+hotfix.5-stable\flutter\packages\flutter\lib\src\gestures\tap.dart:284) BaseTapGestureRecognizer.handlePrimaryPointer (c:\flutter_windows_v1.12.13+hotfix.5-stable\flutter\packages\flutter\lib\src\gestures\tap.dart:219) PrimaryPointerGestureRecognizer.handleEvent (c:\flutter_windows_v1.12.13+hotfix.5-stable\flutter\packages\flutter\lib\src\gestures\recognizer.dart:477) PrimaryPointerGestureRecognizer.handleEvent (c:\flutter_windows_v1.12.13+hotfix.5-stable\flutter\packages\flutter\lib\src\gestures\recognizer.dart:0) _Closure.call (dart:core-patch/function.dart:0) PointerRouter._dispatch (c:\flutter_windows_v1.12.13+hotfix.5-stable\flutter\packages\flutter\lib\src\gestures\pointer_router.dart:78)

Kickbykick avatar Sep 01 '20 06:09 Kickbykick

I apologize for the false alarm but the search and the updateDoc functions do work. I previously had the wrong endpoint.

The flushIndex() and indexExists() still does not work and they give the same error. While I can, what exactly is flushIndex meant to do?

Kickbykick avatar Sep 01 '20 07:09 Kickbykick