Skip to content

Instantly share code, notes, and snippets.

@Yegoroff
Created February 15, 2013 08:47
Show Gist options
  • Save Yegoroff/4959198 to your computer and use it in GitHub Desktop.
Save Yegoroff/4959198 to your computer and use it in GitHub Desktop.
PlainElastic.Net QueryBuilder with Sort and ignore_unmapped parameter
SearchResult<Tweet> searchResult = client.Search(
new SearchCommand("twitter", "tweet"),
new QueryBuilder<Tweet>()
.Query(q => q
.Term(t => t
.Field(tweet => tweet.User)
.Value("testUser")
.Boost(2)
)
)
.Sort(s=>s
.Field(t=>t.Message, order: SortDirection.asc, ignoreUnmapped: true)
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment