summaryrefslogtreecommitdiff
path: root/core/src/main/java/org/elasticsearch/search/suggest/completion
AgeCommit message (Collapse)Author
2017-07-03Remove QueryParseContext (#25486)Christoph Büscher
QueryParseContext is currently only used as a wrapper for an XContentParser, so this change removes it entirely and changes the appropriate APIs that use it so far to only accept a parser instead.
2017-06-22Upgrade to lucene-7.0.0-snapshot-ad2cb77. (#25349)Adrien Grand
Most notable changes: - better update concurrency: LUCENE-7868 - TopDocs.totalHits is now a long: LUCENE-7872 - QueryBuilder does not remove the boolean query around multi-term synonyms: LUCENE-7878 - removal of Fields: LUCENE-7500 For the `TopDocs.totalHits` change, this PR relies on the fact that the encoding of vInts and vLongs are compatible: you can write and read with any of them as long as the value can be represented by a positive int.
2017-05-31Fix context suggester to read values from keyword type field (#24200)Masaru Hasegawa
Closes #24129
2017-04-24Provide informative error message in case of unknown suggestion context. ↵Nilabh Sagar
(#24241) Provide a list of available contexts when you send an unknown context to the completion suggester.
2017-04-18Upgrade to a Lucene 7 snapshot (#24089)Adrien Grand
We want to upgrade to Lucene 7 ahead of time in order to be able to check whether it causes any trouble to Elasticsearch before Lucene 7.0 gets released. From a user perspective, the main benefit of this upgrade is the enhanced support for sparse fields, whose resource consumption is now function of the number of docs that have a value rather than the total number of docs in the index. Some notes about the change: - it includes the deprecation of the `disable_coord` parameter of the `bool` and `common_terms` queries: Lucene has removed support for coord factors - it includes the deprecation of the `index.similarity.base` expert setting, since it was only useful to configure coords and query norms, which have both been removed - two tests have been marked with `@AwaitsFix` because of #23966, which we intend to address after the merge
2017-04-12Allow different data types for category in Context suggester (#23491)Nilabh Sagar
The "category" in context suggester could be String, Number or Boolean. However with the changes in version 5 this is failing and only accepting String. This will have problem for existing users of Elasticsearch if they choose to migrate to higher version; as their existing Mapping and query will fail as mentioned in a bug #22358 This PR fixes the above mentioned issue and allows user to migrate seamlessly. Closes #22358
2017-03-16CompletionSuggestionContext#toQuery() should also consider text if ↵Christoph Büscher
prefix/regex missing (#23451) In cases where the user specifies only the `text` option on the top level suggest element (either via REST or the java api), this gets transferred to the `text` property in the SuggestionSearchContext. CompletionSuggestionContext currently requires prefix or regex to be specified, otherwise errors. We should use the global `text` property as a fallback if neither prefix nor regex is provided. Closes to #23340
2017-02-27Upgrade to lucene-6.5.0-snapshot-d00c5ca (#23385)Jim Ferenczi
Lucene upgrade
2017-02-27Convert suggestion response parsing to use NamedXContentRegistry (#23355)Luca Cavanna
We recently added parsing code to parse suggesters responses into java api objects. This was done using a switch based on the type of the returned suggestion. We can now replace the switch with using NamedXContentRegistry, which will also be used for aggs parsing.
2017-02-20Adding fromXContent to Suggest and Suggestion class (#23226)Christoph Büscher
A follow up to #23202, this adds parsing from xContent and tests to the four Suggestion implementations and the top level suggest element to be used later when parsing the entire SearchResponse.
2017-02-16Adding fromXContent to Suggestion.Entry and subclasses (#23202)Christoph Büscher
This adds parsing from xContent to Suggestion.Entry and its subclasses for Terms-, Phrase- and CompletionSuggestion.Entry.
2017-02-15Add xcontent parsing to completion suggestion option (#23071)Christoph Büscher
This adds parsing from xContent to the CompletionSuggestion.Entry.Option. The completion suggestion option also inlines the xContent rendering of the containes SearchHit, so in order to reuse the SearchHit parser this also changes the way SearchHit is parsed from using a loop-based parser to using a ConstructingObjectParser that creates an intermediate map representation and then later uses this output to create either a single SearchHit or use it with additional fields defined in the parser for the completion suggestion option.
2017-02-10Use `typed_keys` parameter to prefix suggester names by type in search ↵Tanguy Leroux
responses (#23080) This pull request reuses the typed_keys parameter added in #22965, but this time it applies it to suggesters. When set to true, the suggester names in the search response will be prefixed with a prefix that reflects their type.
2017-02-08Fold InternalSearchHits and friends into their interfaces (#23042)Simon Willnauer
We have a bunch of interfaces that have only a single implementation for 6 years now. These interfaces are pretty useless from a SW development perspective and only add unnecessary abstractions. They also require lots of casting in many places where we expect that there is only one concrete implementation. This change removes the interfaces, makes all of the classes final and removes the duplicate `foo` `getFoo` accessors in favor of `getFoo` from these classes.
2017-02-06Remove GeoPointFieldMapper abstractionNicholas Knize
In order to support the evolving GeoPoint encodings in Lucene 5 and 6, ES 2.x and 5.x implements an abstraction layer to the GeoPointFieldMapper classes. As of 5.x the geo_point field mapper settled on using Lucene's more performant LatLonPoint field type and deprecated all other encodings. In 6.0 all encodings except LatLonPoint have been removed rendering this abstraction layer useless. This commit removes the abstraction layer and renames the LatLonPointFieldMapper back to GeoPointFieldMapper to mantain consistency with ES field naming.
2017-02-03Upgrade checkstyle to version 7.5Jason Tedor
This commit upgrades the checkstyle configuration from version 5.9 to version 7.5, the latest version as of today. The main enhancement obtained via this upgrade is better detection of redundant modifiers. Relates #22960
2017-01-12Remove ParseFieldMatcher usages from QueryParseContextjavanna
2017-01-09Replace Suggesters with namedObject (#22491)Nik Everett
Removes another parser registery type thing in favor of `XContentParser#namedObject`.
2017-01-05remove ParseFieldMatcher usages from suggestersjavanna
2016-12-20Introduce XContentParser#namedObject (#22003)Nik Everett
Introduces `XContentParser#namedObject which works a little like `StreamInput#readNamedWriteable`: on startup components register parsers under names and a superclass. At runtime we look up the parser and call it to parse the object. Right now the parsers take a context object they use to help with the parsing but I hope to be able to eliminate the need for this context as most what it is used for at this point is to move around parser registries which should be replaced by this method eventually. I make no effort to do so in this PR because it is big enough already. This is meant to the a start down a road that allows us to remove classes like `QueryParseContext`, `AggregatorParsers`, `IndicesQueriesRegistry`, and `ParseFieldRegistry`. The goal here is to reduce the amount of plumbing required to allow parsing pluggable things. With this you don't have to pass registries all over the place. Instead you must pass a super registry to fewer places and use it to wrap the reader. This is the same tradeoff that we use for NamedWriteable and it allows much, much simpler binary serialization. We think we want that same thing for xcontent serialization. The only parsing actually converted to this method is parsing `ScoreFunctions` inside of `FunctionScoreQuery`. I chose this because it is relatively self contained.
2016-12-17Cleanup random stats serialization code (#22223)Simon Willnauer
Some of our stats serialization code duplicates complicated seriazliation logic or could use existing building blocks from StreamOutput/Input. This commit cleans up some of the serialization code.
2016-11-30Remove 2.x backward compatibility of mappings. (#21670)Adrien Grand
For the record, I also had to remove the geo-hash cell and geo-distance range queries to make the code compile. These queries already throw an exception in all cases with 5.x indices, so that does not hurt any more. I also had to rename all 2.x bwc indices from `index-${version}` to `unsupported-${version}` to make `OldIndexBackwardCompatibilityIT` happy.
2016-10-12Remove empty javadoc (#20871)Tanguy Leroux
This commit removes as many as empty javadocs comments my regexp has found
2016-09-14Remove poor-mans compression in InternalSearchHit and friends (#20472)Simon Willnauer
We still use some crazy poor mans compression in InternalSearchHit that uses a thread local and an unordered map as a lookup table if requested. Stuff like this should be handled by compression on the transport layer rather than in-line in the serialization code. This code is complex enough.
2016-09-13Cut over geo_point field and queries to new LatLonPoint typeNicholas Knize
This commit cuts over geo_point fields to use Lucene's new point-based LatLonPoint type for indexes created in 5.0. Indexes created prior to 5.0 continue to use their respective encoding type. Below is a description of the changes made to support the new encoding type: * New indexes use a new LatLonPointFieldMapper which provides a parse method for the new type * The new LatLonPoint parse method removes support for lat_lon and geohash parameters * Backcompat testing for deprecated lat_lon and geohash parameters is added to all unit and integration tests * LatLonPointFieldMapper provides DocValues support (enabled by default) which uses Lucene's new LatLonDocValuesField type * New LatLonPoint field data classes are added for aggregation support (wraps LatLonPoint's Numeric Doc Values) * MultiFields use the geohash as the string value instead of the lat,lon string making it easier to perform geo string queries on the geohash instead of a lat,lon comma delimited string. Removed Features: * With the removal of geohash indexing, GeoHashCellQuery support is removed for all new indexes (still supported on existing indexes) * LatLonPoint does not support a Distance Range query because it is super inefficient. Instead, the geo_distance_range query should be accomplished using either the geo_distance aggregation, sorting by descending distance on a geo_distance query, or a boolean must not of the excluded distance (which is what the distance_range query did anyway). TODO: * fix/finish yaml changes for plugin and rest integration tests * update documentation
2016-08-10Merge pull request #19920 from cbuescher/remove-SuggestUtilChristoph Büscher
Remove SuggestUtil helper class
2016-08-10Collapse o.e.index.mapper packages. #19921Adrien Grand
I also reduced the visibility of a couple classes and renamed/consolidated some test classes for consistency, eg. removing the `Simple` prefix or using the `<Type>FieldMapperTests` convention for testing field mappers.
2016-08-10Removing use of ParseFields where we have alternative in other classes alreadyChristoph Büscher
2016-08-08Remove payload option from completion suggesterAreek Zillur
The payload option was introduced with the new completion suggester implementation in v5, as a stop gap solution to return additional metadata with suggestions. Now we can return associated documents with suggestions (#19536) through fetch phase using stored field (_source). The additional fetch phase ensures that we only fetch the _source for the global top-N suggestions instead of fetching _source of top results for each shard.
2016-08-05Add support for returning documents with completion suggesterAreek Zillur
This commit enables completion suggester to return documents associated with suggestions. Now the document source is returned with every suggestion, which respects source filtering options. In case of suggest queries spanning more than one shard, the suggest is executed in two phases, where the last phase fetches the relevant documents from shards, implying executing suggest requests against a single shard is more performant due to the document fetch overhead when the suggest spans multiple shards.
2016-08-01Add descriptions for o.e.search.suggest packages (#19699)Nik Everett
Let's have readable javadoc!
2016-07-01Remove some unused codeTanguy Leroux
2016-07-01Fix order of modifiersTanguy Leroux
2016-04-27ConstructingObjectParser is ObjectParser for ctorsNik Everett
ObjectParser makes parsing XContent 95% easier. No more nested loops. No more forgetting to use ParseField. Consistent handling for arrays. Awesome. But ObjectParser doesn't support building things objects whose constructor arguments are mixed in with the rest of its properties. Enter ConstructingObjectParser! ConstructingObjectParser queues up fields until all of the constructor arguments have been parsed and then sets them on the target object. Closes #17352
2016-04-25Add bwc support for pre-5.0 completion indexAreek Zillur
This commit adds support for reading and querying completion fields that were indexed in 2.x
2016-04-21Remove <T> from WriteableNik Everett
It isn't needed any more! Hurray! Closes #17085
2016-04-18Internal: Remove XContentBuilderStringRyan Ernst
This was previously used by xcontentbuilder to support camelCase. However, it is no longer used, and can be replaced with just String.
2016-04-18Merge pull request #17774 from rjernst/camelcase1Ryan Ernst
Rest: Remove 'case' parameter from rest apis
2016-04-18Wrap xcontent parser creation in try-with-resource statement where possibleChristoph Büscher
2016-04-15Pass down parse context instead of just parser in completion context suggester.Christoph Büscher
2016-04-15Remove ParseFieldMatcher from AbstractXContentParserChristoph Büscher
Currently we are able to set a ParseFieldMatcher on XContentParsers, mainly to conveniently carry it around to be available where the actual parsing happens. This was just recently introduced together with ObjectParser so that ObjectParser can make use of deprecation logging and throwing errors while parsing. This however is trappy because we create parsers in so many places in the code and it is easy to forget setting the right ParseFieldMatcher. Instead we should hold the ParseFieldMatcher only in the parse contexts (e.g. QueryParseContext). This PR removes the ParseFieldMatcher from XContentParser. ObjectParser can still make use of it because we can make the otherwise unbounded `context` type to extend an interface that makes sure contexts used in ObjectParser can supply a ParseFieldMatcher. Contexts in ObjectParser are now no longer optional, but it is sufficient to pass in a small lambda expression in places where no other context is available. Relates to #17417
2016-04-14Rest: Remove 'case' parameter from rest apisRyan Ernst
The current api allows for choosing which "case" response json keys are written in. This has the options of camelCase or underscore. camelCase is going to be deprecated from the query apis. However, with the case api, it is not necessary to deprecate, as users who were using it in 2.x can transition completely on 2.x before upgrading by simply using the underscore option. This change removes the 'case' option from rest apis. see #8988
2016-04-14Remove remaining PROTOTYPEs from org.elasticsearch.search.suggestNik Everett
2016-04-11Upgrade Lucene 6 ReleaseAdrien Grand
* upgrades numerics to new Point format * updates geo api changes * adds GeoPointDistanceRangeQuery as XGeoPointDistanceRangeQuery * cuts over to ES GeoHashUtils
2016-03-29Remove PROTOTYPEs from suggestersNik Everett
Also stops using guice for suggesters at all and lots of checkstyle.
2016-03-11nuke SuggestParseElementAreek Zillur
2016-03-11scope internal methods in suggest buildersAreek Zillur
2016-03-09incorporate feedbackAreek Zillur
2016-03-09cleanupAreek Zillur
2016-03-09construct suggestion context from query contextAreek Zillur