TL:DR

With the More Like This query, Elasticsearch gives an easy and powerful way to find contents similar to what your users are currently watching. 

It’s a key point to improve your retention, and your ROI 

More Like This Query : Suggest related content

Any company that edits a website, or any content centred tool has one only goal: Improve Transformation.
It can be a contact form, a newsletter subscription, an online purchase, a click on an advert or simply finding the best info.

So suggestions will help a lot to keep visitors on your website and navigate better in all the huge amount of high quality content you deliver. 

And it can be added in a few minutes.
Just give the watched content to elastic ; add few filters and you got it : 

previous arrow
next arrow
Shadow
Slider

How to use the More Like This Query ? 

The easiest way to find similar content is to send the id of an elasticsearch document in the more like this. 

GET elastic-posts-*/_search
{
  "query": {
    "more_like_this": {
      "like": [
        {
          "_id": 4133
        }
      ]
    }
  }

Of course you can fine tune a lot of things, like fields used for comparison, custom stop words, or the source index. 

{
  "query": {
    "more_like_this": {
      "fields": [
        "title", "content"
      ],
     "like": [
        {
                "_index" : "elastic-posts-*",
                "_id" : "4133"
            }
            ],
      "minimum_should_match": 1
    }
  }
}

Even better, no need to have the content within Elasticsearch, you can send a custom text in the like clause : 

{
  "query": {
    "more_like_this": {
      "fields": ["content_filtered", "title"], 
      "like": [
        "Increase your ROI and the sessions durations on your website in less than an hour of work.",
        "optimize your search results in a user friendly interface without any technical knowledge"
      ]
    }
  }
}

Then, it opens a world of possibilities. AS the MLT is a normal _search query clause, it’s easy to filter the results to match only a category and to influence the score. 

Let’s imagine you manage a phone online store. 

When your user is looking at the last Iphone, you can easily show him other more expensive similar products.

{
  "query": {
    "bool": {
      "must": [
        {
          "more_like_this": {
            "like": [
              {
                "_id": "4133"
              }
            ]
          }
        }
      ],
      "should": [
        {
          "range": {
            "price": {
              "gte": 1000.00,
              "boost": 100
            }
          }
        }
      ],
      "filter": [
        {
          "term": {
            "category": "phone"
          }
        }
      ]
    }
  }
}
  }
}

The official documentation is pretty clear on all the parameters of the MLT query :

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html

Conclusion : Good suggester doesn’t necessarily need IA to be powerful

Nowadays, when a company ask for suggestions features, Consulting agencies will talk about Machine learning, Natural Language Processing, Automatic classification, and will deploy the strongest scientists for weeks.
It’s very powerful of course (and pretty cool), ideal for Netflix or Salesforce, and Elasticsearch is a great back-end tool for those uses cases to.

But when it’s possible, don’t forget to keep your integrations simple, thanks the easy and incredibly powerful More Like This query of your Elasticsearch. 

Spoon consulting is a certified partner of Elastic

As a certified partner of the Elastic company, Spoon Consulting offers a high level consulting for all kinds of companies.

Read more information on your personal use Elasticsearch use case on Spoon consulting’s posts

Or contact Spoon consulting now