Closed
Description
Hi,
Been trying out NEST 2.0.0-Alpha 1 and I think there are some changes that could be important do document. If you try to add something to a boolean that's not "complete", it's not added. This is a bit different to the NEST 1.x behaviour.
Example:
var oldNest = new SearchDescriptor<TestObject>()
.Index("index")
.Type("type")
.Query(q => q
.Bool(b => b
.Must(m => m.MatchAll())
.Should(s => s
.Fuzzy(f => f
.Field("name")
.Value("testvalue")))));
Produces in NEST 1.7.1:
{
"query": {
"bool": {
"must": [
{
"match_all": {}
}
],
"should": [
{
"fuzzy": {
"name": {
"value": "testvalue"
}
}
}
]
}
}
}
But in NEST 2.0.0 Alpha 1, it produces:
{
"query": {
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
}
If you then change it to be the following:
var newNest = new SearchDescriptor<TestObject>()
.Index("index")
.Type("type")
.Query(q => q
.Bool(b => b
.Must(m => m.MatchAll())
.Should(s => s
.Fuzzy(f => f
.Field("name")
.Value("testvalue")
.Fuzziness(Fuzziness.Auto)))));
it produces the expected output in NEST 2.0.0 Alpha 1:
{
"query": {
"bool": {
"must": [
{
"match_all": {}
}
],
"should": [
{
"fuzzy": {
"name": {
"value": "testvalue",
"fuzziness": "AUTO"
}
}
}
]
}
}
}
This seems to apply to QueryString
as well (the DefaultField
must be set). I have not checked any of the other queries.
Metadata
Metadata
Assignees
Labels
No labels