searchReviews(query, lang = 'en') {
    // Add text fields
    let options = search.getSearchOptions('text', lang);

    // Add title fields
    let titleOptions = search.getSearchOptions('title', lang);
    options.fields = options.fields.concat(titleOptions.fields);

    Object.assign(options.highlight.fields, titleOptions.highlight.fields);
    return client.search({
      index: 'libreviews',
      body: {
        query: {
          has_child: {
            type: 'review',
            query: {
              simple_query_string: {
                fields: options.fields,
                query,
                default_operator: 'and'
              }
            },
            inner_hits: {
              highlight: options.highlight
            },
          }
        }
      }
    });
  }
// the thing via parent-child join. The review is returned as an inner hit.
the thing via parent-child join. The review is returned as an inner hit.
the thing via parent - child join . The review is returned as an inner hit .
searchReviews(query, lang = 'en') {
    let options = search.getSearchOptions('text', lang);
    let titleOptions = search.getSearchOptions('title', lang);
    options.fields = options.fields.concat(titleOptions.fields);
    Object.assign(options.highlight.fields, titleOptions.highlight.fields);
    return client.search({
      index: 'libreviews',
      body: {
        query: {
          has_child: {
            type: 'review',
            query: {
              simple_query_string: {
                fields: options.fields,
                query,
                default_operator: 'and'
              }
            },
            inner_hits: {
              highlight: options.highlight
            },
          }
        }
      }
    });
  }
searchReviews ( query , lang = 'en' ) { let options = search . getSearchOptions ( 'text' , lang ) ; let titleOptions = search . getSearchOptions ( 'title' , lang ) ; options . fields = options . fields . concat ( titleOptions . fields ) ; Object . assign ( options . highlight . fields , titleOptions . highlight . fields ) ; return client . search ( { index : 'libreviews' , body : { query : { has_child : { type : 'review' , query : { simple_query_string : { fields : options . fields , query , default_operator : 'and' } } , inner_hits : { highlight : options . highlight } , } } } } ) ; }
the thing via parent-child join.
the thing via parent - child join .
// Add text fields // Add title fields