13 Commits

Author SHA1 Message Date
javanna
add18a5c99 Java api: remove duplicated buildAsBytes and corresponding toString methods
We have some builders, specifically query builders, `SearchSourceBuilder`, `QuerySourceBuilder` and `SuggestBuilder`, that implement `ToXContent` and also allow to build their content as bytes by simply creating a `BytesReference` that holds their json (or yaml etc.) content (`buildAsBytes` methods). They can also print out their content through `toString`. Made sure that those common methods are in one single place and reused where needed.

Also, merged `QueryBuilder` and `BaseQueryBuilder` and made `QueryBuilder` an abstract class instead of an interface.

Closes #11063
2015-05-13 16:14:16 +02:00
Adrien Grand
630757906a Query DSL: Add filter clauses to bool queries.
These clauses filter the document space without affecting scoring and map to
Lucene's BooleanClause.Occur.FILTER. The `filtered` query is now deprecated and

```json
{
  "filtered": {
    "query": { //query },
    "filter": { //filter }
  }
}
```
should be replaced with
```json
{
  "bool": {
    "must": { //query },
    "filter": { //filter }
  }
}
```
2015-05-13 12:04:56 +02:00
olivier bourgain
2c4aaa0838 [DOCS] fix typo in BoolQueryBuilder javadocs 2015-03-10 08:21:34 -07:00
Robert Muir
0fa5b87fdd Add missing @Override annotations.
These help a lot when refactoring, upgrading lucene, etc, and
can prevent code duplication (as you get a compile error for outdated stuff).

Closes #9832.
2015-02-23 17:08:28 -05:00
Simon Willnauer
1952df982b [JAVA7 Upgrade] Replace explicit type with <> 2014-03-27 15:54:45 +01:00
Simon Willnauer
047119d92e Add BoolFilterBuilder#hasClauses to be consitent with BoolQueryBuilder
Closes #5472
2014-03-20 13:05:04 +01:00
Simon Willnauer
10ec2e948a Fix ASL Header in source files to reflect s/ElasticSearch/Elasticsearch
This commit also removes the license to Shay Banon in favor of soley
Elasticsearch. Thanks Shay for this awesome product you took it far!

Closes #4636
2014-01-07 11:22:01 +01:00
Martijn van Groningen
60ac34ff3a Added _name support to queries.
This extends the named filter support from only filters to also queries.

Closes #3581
2013-08-28 10:42:53 +02:00
Simon Willnauer
7f0115ba9a Return nothing instead of everything in MLT if no field is supported.
Today due the optimizations in the boolean query builder we adjust
a pure negative query with a 'match_all'. This is not the desired
behavior in the MLT API if all the fields in a document are unsupported.
If that happens today we return all documents but the one MLT is
executed on.

Closes #3453
2013-08-07 13:25:09 +02:00
Shay Banon
14c11a94fb MinimumNumberShouldMatch inconcistency, closes #2194
Streamline the use of minimum should match to all relevant queries to accept `minimum_should_match`, and allow all relevant queries to accept the advanced "string" based config
2012-08-22 14:15:08 +02:00
Nicolas Lalevée
898fef11c9 Add an interface about "boost settable" query builders 2012-06-07 23:35:21 +02:00
Shay Banon
6a71eab51f finalize structure, tests pass 2011-12-06 02:43:17 +02:00
Shay Banon
a8fd2d48b8 first cleanup phase, move to single src 2011-12-06 00:59:23 +02:00