summaryrefslogtreecommitdiff
path: root/core/src/main/java/org/elasticsearch/search/suggest/completion
AgeCommit message (Collapse)Author
2016-03-03Suggestions: Make field name mandatory ctor argumentChristoph Büscher
The field name is a required argument for all suggesters, but it was specified via a field() setter in SuggestionBuilder so far. This changes field name to being a mandatory constructor argument and lets suggestion builders throw an error if field name is missing or the empty string.
2016-03-01Suggest: Move name of suggestion to SuggestBuilderChristoph Büscher
Currently each suggestion keeps track of its own name. This has the disadvantage of having to pass down the parsed name property in the suggestions fromXContent() and the serialization methods as an argument, since we need it in the ctor. This change moves the naming of the suggestions to the surrounding SuggestBuilder and by this eliminates the need for passind down the names in the parsing and serialization methods. By making `name` a required argument in SuggestBuilder#addSuggestion() we also make sure it is always set and prevent using the same name twice, which wasn't possible before.
2016-02-12Merge remote-tracking branch 'upstream/master' into feature-suggest-refactoringAli Beyad
2016-02-11Merge remote-tracking branch 'upstream/feature-suggest-refactoring' into ↵Ali Beyad
term-suggest-build
2016-02-11Refactors building query specific objects from the term suggestionAli Beyad
builder and merges changes between the suggestion builders to context object implementations.
2016-02-11upgrade to lucene 5.5.0-snapshot-850c6c2Nicholas Knize
2016-02-10initial refactoring of completion suggesterAreek Zillur
2016-02-10Adding method to build SuggestionContext to PhraseSuggestionBuilderChristoph Büscher
This adds a build method for the SuggestionContext to the PhraseSuggestionBuilder and another one that creates the SuggestionSearchContext to the top level SuggestBuilder. Also adding tests that make sure the current way of parsing xContent to a SuggestionContext is reflected in the output the builders create.
2016-02-09Building the term suggesters from the builder objectAli Beyad
2016-02-09Changing parse signature in QueryParseElementChristoph Büscher
2016-02-09WIP adding build() method to PhraseSuggestionBuilderChristoph Büscher
2016-02-08Suggest: Add parsing from xContent to PhraseSuggestionBuilderChristoph Büscher
For the ongoing search refactoring (#10217) the PhraseSuggestionBuilder gets a way of parsing from xContent that will eventually replace the current SuggestParseElement. This PR adds the fromXContent method to the PhraseSuggestionBuilder and also adds parsing code for the common suggestion parameters to SuggestionBuilder. Also adding links from the Suggester implementations registeres in the Suggesters registry to the corresponding prototype that is going to be used for parsing once the refactoring is done and we switch from parsing on shard to parsing on coordinating node.
2016-02-03Refactored the term suggestion builder for the query refactoring effortAli Beyad
Added the term suggestion builder's serialization/deserialization and equals/hashCode methods.
2016-01-28Merge branch 'master' into feature-suggest-refactoringChristoph Büscher
2016-01-27Initial refactoring for phrase suggesterChristoph Büscher
Adding initial serialization methods (readFrom, writeTo) to the PhraseSuggestionBuilder, also adding the base test framework for serialiazation testing, equals and hashCode. Moving SuggestionBuilder out of the global SuggestBuilder for better readability.
2016-01-21Merge branch 'master' into trash_context_and_headersSimon Willnauer
2016-01-20Fixing small issues and using ParseFields in CompletionSuggestParserChristoph Büscher
2016-01-13Replace ContextAndHeaders with a ThreadPool based ThreadLocal implementationSimon Willnauer
ContextAndHeaders has a massive impact on the core infrastructure since it has to be manually passed on to all relevant places across threads/network calls etc. For the same reason it's also very error prone and easily forgotten on potentially relevant APIs. The new ThreadContext is associated with a ThreadPool (node or transport client) and ensures that headers and context registered on a current thread are inherited to new threads spawned, send across the network to be deserialized on the receiver end as well as restored on the response handling thread once the response is received.
2015-12-23Remove `index_name` back compat.Adrien Grand
Since 2.0 we enforce that fields have the same full and index names. So in 3.x we can remove the ability to have different names on the same field.
2015-12-18Remove wildcard importsRyan Ernst
2015-12-17Simplify the Text API.Adrien Grand
We have the Text API, which is essentially a wrapper around a String and a BytesReference and then we have 3 implementations depending on whether the String view should be cached, the BytesReference view should be cached, or both should be cached. This commit merges everything into a single Text that is essentially the old StringAndBytesText impl. Long term we should look into whether this API has any performance benefit or if we could just use plain strings. This would greatly simplify all our other APIs that currently use Text.
2015-12-02Remove and forbid use of the type-unsafe empty Collections fieldsJason Tedor
This commit removes and now forbids all uses of the type-unsafe empty Collections fields Collections#EMPTY_LIST, Collections#EMPTY_MAP, and Collections#EMPTY_SET. The type-safe methods Collections#emptyList, Collections#emptyMap, and Collections#emptySet should be used instead.
2015-11-29improve javadocsMichael McCandless
2015-11-29only pull Fields once from the readerMichael McCandless
2015-11-12Enable GeoPointV2 with backward compatibility testingNicholas Knize
This commit removes all noreleases and cuts over to Lucene 5.4 GeoPointField type. Included are randomized testing updates to unit and integration test suites for ensuring full backward compatability with existing geo_point indexes.
2015-11-07fix conflicts from mergeAreek Zillur
2015-11-07fix comments and throw ElasticsearchException when we fail to report fst ↵Areek Zillur
index size
2015-11-07add query context buildersAreek Zillur
2015-11-07remove nocommitAreek Zillur
2015-11-07add back awaitfix testsAreek Zillur
2015-11-07more parsersSimon Willnauer
2015-11-07add parsersSimon Willnauer
2015-11-07some basic cleanupsSimon Willnauer
2015-11-07cut over to using ObjectParser for context mappingsAreek Zillur
2015-11-07added FuzzyOptionsBuilder javadocs and cleanupsAreek Zillur
2015-11-07Completion Suggester V2Areek Zillur
The completion suggester provides auto-complete/search-as-you-type functionality. This is a navigational feature to guide users to relevant results as they are typing, improving search precision. It is not meant for spell correction or did-you-mean functionality like the term or phrase suggesters. The completions are indexed as a weighted FST (finite state transducer) to provide fast Top N prefix-based searches suitable for serving relevant results as a user types. closes #10746
2015-11-02Cleanup query parsing and remove IndexQueryParserServiceSimon Willnauer
IndexQueryParserService is only a factory for QueryShardContext instances which are not even bound to a shard. The service only forwards dependencies and even references node level service directly which makes dependency seperation on shard, index and node level hard. This commit removes the service entirely, folds the creation of QueryShardContext into IndexShard which is it's logical place and detaches the ClusterService needed for index name matching during query parsing with a simple predicate interface on IndexSettings.
2015-10-28Remove support for edit_distance in completion suggesterjavanna
Replaced by fuzziness, consistent with other queries.
2015-10-05Ban ImmutableMap$Builder in core's mainNik Everett
Almost there!
2015-09-30cutover more Analyzer.tokenStream to try-with-resourcesmikemccand
2015-09-09Remove and forbid use of com.google.common.collect.MapsJason Tedor
This commit removes and now forbids all uses of com.google.common.collect.Maps across the codebase. This is one of many steps in the eventual removal of Guava as a dependency. Relates #13224
2015-09-02Scripting: Propagate Headers and Context through to ScriptServiceColin Goodheart-Smithe
At the moment if an index script is used in a request, the spawned request to get the indexed script from the `.scripts` index does not get the headers and context copied to it from the original request. This change makes the calls to the `ScriptService` pass in a `HasContextAndHeaders` object that can provide the headers and context. For the `search()` method the context and headers are retrieved from `SearchContext.current()`. Closes #12891
2015-09-01Upgrade to lucene-5.3.0.Adrien Grand
From a user perspective, the main benefit from this upgrade is that the new Lucene53Codec has disk-based norms. The elasticsearch directory has been fixed to load these norms through mmap instead of nio. Other changes include the removal of `max_thread_states`, the fact that PhraseQuery and BooleanQuery are now immutable, and that deleted docs are now applied on top of the Scorer API. This change introduces a couple of `AwaitsFix`s but I don't think it should hold us from merging.
2015-08-13Introduce a formal ExtensionPoint class to stream line extensionsSimon Willnauer
This commit tries to add some infrastructure to streamline how extension points should be strucutred. It's a simple approache with 4 implementations for `highlighter`, `suggester`, `allocation_decider` and `shards_allocator`. It simplifies adding new extension points and forces to register classes instead of strings.
2015-07-02Internal: make sure ParseField is always used in combination with parse flagsjavanna
Removed ParseField#match variant that accepts the field name only, without parse flags. Such a method is harmful as it defaults to empty parse flags, meaning that no deprecation exceptions will be thrown in strict mode, which defeats the purpose of using ParseField. Unfortunately such a method was used in a lot of places were the parse flags weren't easily accessible (outside of query parsing), and in a lot of other places just by mistake. Parse flags have been introduced now as part of SearchContext and mappers where needed. There are a few places (e.g. java api requests) where it is not possible to retrieve them as they depend on the index settings, in that case we explicitly pass in EMPTY_FLAGS for now, but this has to be seen as an exception. Closes #11859
2015-06-09Mappings: Make index level mapping apis use MappedFieldTypeRyan Ernst
The MapperService is the "index wide view" of mappings. Methods on it are used at query time to lookup how to query a field. This change reduces the exposed api so that any information returned is limited to that api exposed by MappedFieldType. In the future, MappedFieldType will be guaranteed to be the same across all document types for a given field. Note CompletionFieldType needed some more settings moved to it. Other than that, this change is almost purely cosmetic.
2015-06-05create core moduleSimon Willnauer