nodes: 0, module; 1, function_definition; 2, function_name:get_search_result; 3, parameters; 4, block; 5, identifier:self; 6, identifier:ddoc_id; 7, identifier:index_name; 8, dictionary_splat_pattern; 9, expression_statement; 10, expression_statement; 11, return_statement; 12, identifier:query_params; 13, comment:"""
          Retrieves the raw JSON content from the remote database based on the
          search index on the server, using the query_params provided as query
          parameters. A ``query`` parameter containing the Lucene query
          syntax is mandatory.
  
          Example for search queries:
  
          .. code-block:: python
  
              # Assuming that 'searchindex001' exists as part of the
              # 'ddoc001' design document in the remote database...
              # Retrieve documents where the Lucene field name is 'name' and
              # the value is 'julia*'
              resp = db.get_search_result('ddoc001', 'searchindex001',
                                          query='name:julia*',
                                          include_docs=True)
              for row in resp['rows']:
                  # Process search index data (in JSON format).
  
          Example if the search query requires grouping by using
          the ``group_field`` parameter:
  
          .. code-block:: python
  
              # Assuming that 'searchindex001' exists as part of the
              # 'ddoc001' design document in the remote database...
              # Retrieve JSON response content, limiting response to 10 documents
              resp = db.get_search_result('ddoc001', 'searchindex001',
                                          query='name:julia*',
                                          group_field='name',
                                          limit=10)
              for group in resp['groups']:
                  for row in group['rows']:
                  # Process search index data (in JSON format).
  
          :param str ddoc_id: Design document id used to get the search result.
          :param str index_name: Name used in part to identify the index.
          :param str bookmark: Optional string that enables you to specify which
              page of results you require. Only valid for queries that do not
              specify the ``group_field`` query parameter.
          :param list counts: Optional JSON array of field names for which
              counts should be produced. The response will contain counts for each
              unique value of this field name among the documents matching the
              search query.
              Requires the index to have faceting enabled.
          :param list drilldown:  Optional list of fields that each define a
              pair of a field name and a value. This field can be used several
              times.  The search will only match documents that have the given
              value in the field name. It differs from using
              ``query=fieldname:value`` only in that the values are not analyzed.
          :param str group_field: Optional string field by which to group
              search matches.  Fields containing other data
              (numbers, objects, arrays) can not be used.
          :param int group_limit: Optional number with the maximum group count.
              This field can only be used if ``group_field`` query parameter
              is specified.
          :param group_sort: Optional JSON field that defines the order of the
              groups in a search using ``group_field``. The default sort order
              is relevance. This field can have the same values as the sort field,
              so single fields as well as arrays of fields are supported.
          :param int limit: Optional number to limit the maximum count of the
              returned documents. In case of a grouped search, this parameter
              limits the number of documents per group.
          :param query/q: A Lucene query in the form of ``name:value``.
              If name is omitted, the special value ``default`` is used.
              The ``query`` parameter can be abbreviated as ``q``.
          :param ranges: Optional JSON facet syntax that reuses the standard
              Lucene syntax to return counts of results which fit into each
              specified category. Inclusive range queries are denoted by brackets.
              Exclusive range queries are denoted by curly brackets.
              For example ``ranges={"price":{"cheap":"[0 TO 100]"}}`` has an
              inclusive range of 0 to 100.
              Requires the index to have faceting enabled.
          :param sort: Optional JSON string of the form ``fieldname<type>`` for
              ascending or ``-fieldname<type>`` for descending sort order.
              Fieldname is the name of a string or number field and type is either
              number or string or a JSON array of such strings. The type part is
              optional and defaults to number.
          :param str stale: Optional string to allow the results from a stale
              index to be used. This makes the request return immediately, even
              if the index has not been completely built yet.
          :param list highlight_fields: Optional list of fields which should be
              highlighted.
          :param str highlight_pre_tag: Optional string inserted before the
              highlighted word in the highlights output.  Defaults to ``<em>``.
          :param str highlight_post_tag: Optional string inserted after the
              highlighted word in the highlights output.  Defaults to ``</em>``.
          :param int highlight_number: Optional number of fragments returned in
              highlights. If the search term occurs less often than the number of
              fragments specified, longer fragments are returned.  Default is 1.
          :param int highlight_size: Optional number of characters in each
              fragment for highlights.  Defaults to 100 characters.
          :param list include_fields: Optional list of field names to include in
              search results. Any fields included must have been indexed with the
              ``store:true`` option.
  
          :returns: Search query result data in JSON format
          """; 14, assignment; 15, call; 16, identifier:ddoc; 17, call; 18, attribute; 19, argument_list; 20, identifier:DesignDocument; 21, argument_list; 22, identifier:self; 23, identifier:_get_search_result; 24, call; 25, dictionary_splat; 26, identifier:self; 27, identifier:ddoc_id; 28, attribute; 29, argument_list; 30, identifier:query_params; 31, string; 32, identifier:join; 33, tuple; 34, string_content:/; 35, attribute; 36, string; 37, identifier:index_name; 38, identifier:ddoc; 39, identifier:document_url; 40, string_content:_search
code: def get_search_result(self, ddoc_id, index_name, **query_params):
          """
          Retrieves the raw JSON content from the remote database based on the
          search index on the server, using the query_params provided as query
          parameters. A ``query`` parameter containing the Lucene query
          syntax is mandatory.
  
          Example for search queries:
  
          .. code-block:: python
  
              # Assuming that 'searchindex001' exists as part of the
              # 'ddoc001' design document in the remote database...
              # Retrieve documents where the Lucene field name is 'name' and
              # the value is 'julia*'
              resp = db.get_search_result('ddoc001', 'searchindex001',
                                          query='name:julia*',
                                          include_docs=True)
              for row in resp['rows']:
                  # Process search index data (in JSON format).
  
          Example if the search query requires grouping by using
          the ``group_field`` parameter:
  
          .. code-block:: python
  
              # Assuming that 'searchindex001' exists as part of the
              # 'ddoc001' design document in the remote database...
              # Retrieve JSON response content, limiting response to 10 documents
              resp = db.get_search_result('ddoc001', 'searchindex001',
                                          query='name:julia*',
                                          group_field='name',
                                          limit=10)
              for group in resp['groups']:
                  for row in group['rows']:
                  # Process search index data (in JSON format).
  
          :param str ddoc_id: Design document id used to get the search result.
          :param str index_name: Name used in part to identify the index.
          :param str bookmark: Optional string that enables you to specify which
              page of results you require. Only valid for queries that do not
              specify the ``group_field`` query parameter.
          :param list counts: Optional JSON array of field names for which
              counts should be produced. The response will contain counts for each
              unique value of this field name among the documents matching the
              search query.
              Requires the index to have faceting enabled.
          :param list drilldown:  Optional list of fields that each define a
              pair of a field name and a value. This field can be used several
              times.  The search will only match documents that have the given
              value in the field name. It differs from using
              ``query=fieldname:value`` only in that the values are not analyzed.
          :param str group_field: Optional string field by which to group
              search matches.  Fields containing other data
              (numbers, objects, arrays) can not be used.
          :param int group_limit: Optional number with the maximum group count.
              This field can only be used if ``group_field`` query parameter
              is specified.
          :param group_sort: Optional JSON field that defines the order of the
              groups in a search using ``group_field``. The default sort order
              is relevance. This field can have the same values as the sort field,
              so single fields as well as arrays of fields are supported.
          :param int limit: Optional number to limit the maximum count of the
              returned documents. In case of a grouped search, this parameter
              limits the number of documents per group.
          :param query/q: A Lucene query in the form of ``name:value``.
              If name is omitted, the special value ``default`` is used.
              The ``query`` parameter can be abbreviated as ``q``.
          :param ranges: Optional JSON facet syntax that reuses the standard
              Lucene syntax to return counts of results which fit into each
              specified category. Inclusive range queries are denoted by brackets.
              Exclusive range queries are denoted by curly brackets.
              For example ``ranges={"price":{"cheap":"[0 TO 100]"}}`` has an
              inclusive range of 0 to 100.
              Requires the index to have faceting enabled.
          :param sort: Optional JSON string of the form ``fieldname<type>`` for
              ascending or ``-fieldname<type>`` for descending sort order.
              Fieldname is the name of a string or number field and type is either
              number or string or a JSON array of such strings. The type part is
              optional and defaults to number.
          :param str stale: Optional string to allow the results from a stale
              index to be used. This makes the request return immediately, even
              if the index has not been completely built yet.
          :param list highlight_fields: Optional list of fields which should be
              highlighted.
          :param str highlight_pre_tag: Optional string inserted before the
              highlighted word in the highlights output.  Defaults to ``<em>``.
          :param str highlight_post_tag: Optional string inserted after the
              highlighted word in the highlights output.  Defaults to ``</em>``.
          :param int highlight_number: Optional number of fragments returned in
              highlights. If the search term occurs less often than the number of
              fragments specified, longer fragments are returned.  Default is 1.
          :param int highlight_size: Optional number of characters in each
              fragment for highlights.  Defaults to 100 characters.
          :param list include_fields: Optional list of field names to include in
              search results. Any fields included must have been indexed with the
              ``store:true`` option.
  
          :returns: Search query result data in JSON format
          """
          ddoc = DesignDocument(self, ddoc_id)
          return self._get_search_result(
              '/'.join((ddoc.document_url, '_search', index_name)),
              **query_params
          )