More Like This Full Document Query Usageedit

Fluent DSL exampleedit

q
.MoreLikeThis(sn => sn
    .Fields(f=>f.Field(p=>p.Name))
    .Like(l=>l
        .Document(d=>d.Document(Project.Instance))
        .Text("some long text")
    )
)

Object Initializer syntax exampleedit

new MoreLikeThisQuery
{
    Fields = Fields<Project>(p=>p.Name),
    Like = new List<Like>
    {
        new LikeDocument<Project>(Project.Instance),
        "some long text"
    }
}

Example json output. 

{
  "more_like_this": {
    "fields": [
      "name"
    ],
    "like": [
      {
        "_index": "project",
        "_type": "doc",
        "_id": "Durgan LLC",
        "_routing": "Durgan LLC",
        "doc": {
          "name": "Koch, Collier and Mohr",
          "state": "BellyUp",
          "startedOn": "2015-01-01T00:00:00",
          "lastActivity": "0001-01-01T00:00:00",
          "leadDeveloper": {
            "gender": "Male",
            "id": 0,
            "firstName": "Martijn",
            "lastName": "Laarman"
          },
          "location": {
            "lat": 42.1523,
            "lon": -80.321
          }
        }
      },
      "some long text"
    ]
  }
}