Java Boolean Match Query

Hi,

how do I specify a boolean match query in Java? E.g. something like

{
"match" : {
"message" : {
"query" : "this is a test",
"operator" : "and"
}
}
}

I tried something like

QueryBuilders.matchQuery( elasticsearchField, searchStrings ).operator( MatchQueryBuilder.Operator.AND )

where searchStrings is a List of Strings, but this doesn't return any
results.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

have you tried making it a string like "this is a test" and not a list of
strings? In case that is not working, can you provide a gist with a sample?

--Alex

On Thu, Apr 18, 2013 at 2:08 PM, Pat elasticsearch@hushmail.com wrote:

Hi,

how do I specify a boolean match query in Java? E.g. something like

{
"match" : {
"message" : {
"query" : "this is a test",
"operator" : "and"
}
}
}

I tried something like

QueryBuilders.matchQuery( elasticsearchField, searchStrings ).operator( MatchQueryBuilder.Operator.AND )

where searchStrings is a List of Strings, but this doesn't return any
results.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

This works, thanks! Neither String nor a List seems to work,
though.

Am Freitag, 19. April 2013 09:12:08 UTC+2 schrieb Alexander Reelsen:

Hey,

have you tried making it a string like "this is a test" and not a list of
strings? In case that is not working, can you provide a gist with a sample?

--Alex

On Thu, Apr 18, 2013 at 2:08 PM, Pat <elasti...@hushmail.com <javascript:>

wrote:

Hi,

how do I specify a boolean match query in Java? E.g. something like

{
"match" : {

    "message" : {
        "query" : "this is a test",

        "operator" : "and"
    }

}

}

I tried something like

QueryBuilders.matchQuery( elasticsearchField, searchStrings ).operator( MatchQueryBuilder.Operator.AND )

where searchStrings is a List of Strings, but this doesn't return any
results.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.