I am trying a develop a hybrid search query by combing ELSER Semantic and Full Text searches using Python client. Below is my sample code. I am getting a error
'[sub_searches] query malformed, no start_object after query name')
Looks i am missing some think in Syntax. Any help is welcome.
When i keep sub_searches under top level in my code, i am getting error that Elasticsearch.search() got an unexpected keyword argument 'sub_searches'.
The link that you pointed has CURL code, that works inside Dev Tool Console. But when i am writing python i am missing something minor thing. I searhed on Elastic Websites and open internet for a sample python code, but no luck.
A wokring sample python code for 'sub_searches' would be of great help.
sub_searches is still in technical preview and not currently supported by the python lang client. The error you see is being thrown by the client, due to unsupported syntax.
ConnectionError: Connection error caused by: ConnectionError(Connection error caused by: HostChangedError(HTTPSConnectionPool(host='10.32.25.065', port=9200): Tried to open a foreign host with url: sales_content/_search))
Also there is a statement in the tutorial link that says : With this version, the sub_searches argument can be used to send multiple search queries as follows:
What is intented to convey by With this version ? What version ? which library ?
Might be down to your indexName is incorrect. In your example, you are performing a search to sales_content_appbriefs_test_dele and the python code is sales_content
Python Lang client version should match the Elasticsearch version.
The version is talking specifically that the version of how the query is called (in previous examples we are calling using the search method, now been changed with perform_request. Its not talking about the version of the client.
Thanks.
Index name i am using is correct. I am trying with different names. Two different names are seen in earlier code and previous code is just due to the face that they come from 2 different trails.
May i know what exactly the Path ? Is this path=f'sales_content/_search', is correct if want to search index name sales_content ?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.