KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have been working with the ElasticSearch from last few months, but still find it complicated when I have to pass an complicated query. I want to run the query which will have to search the multiple "types" and each type has to be searched with its own "filters", but need to have combined "searched results" For example: I need to search the "user type" document which are my friends and on the same time i have to search the "object type" document which I like, according to the keyword provided. OR The query that has both the "AND" and "NOT" clause Example query: $options['query'] = array( 'query' => array( 'filtered' => array( 'query' => array( 'query_string' => array( 'default_field' => 'name', 'query' => $this->search_term . '*', ), ), 'filter' => array( 'and' => array( array( 'term' => array( 'access_id' => 2, ), ), ), 'not' => array( array( 'term' => array( 'follower' => 32, ), ), array( 'term' => array( 'fan' => 36, ), ), ), ), ), ), ); as this query is meant to search the user with access_id = 2, but must not have the follower of id 32 and fan of id 36 but this is not working.. Edit: Modified query { "quer
Tags (comma-separated)
Save Edits
Cancel