search-suggestion

ElasticSearch 5 adding context to SuggestionBuilders

末鹿安然 提交于 2019-12-23 03:49:06
问题 I am working on ES5 through java, and am trying to add context to a CompletionSuggestionBuilder. I have a map of String objects that need to be added. The code I have so far is - Map<String, String> context = ... CompletionSuggestionBuilder csb = SuggestBuilders.completionSuggestion(field).text(value).size(count); How do I add context objects to csb ? I think the method to use is - csb.contexts(Map<String, List<? extends ToXContent>> queryContexts) But I don't know how to get from my map to

How can i get unique suggestions without duplicates when i use completion suggester?

时间秒杀一切 提交于 2019-12-22 04:16:08
问题 I am using elastic 5.1.1 in my environment. I have chosen completion suggester on a field name post_hashtags with an array of strings to have suggestion on it. I am getting response as below for prefix "inv" Req: POST hashtag/_search?pretty&&filter_path=suggest.hash-suggest.options.text,suggest.hash-suggest.options._source {"_source":["post_hashtags" ], "suggest": { "hash-suggest" : { "prefix" : "inv", "completion" : { "field" : "post_hashtags" } } } Response : { "suggest": { "hash-suggest":

SearchView Filtering and Set Suggestions

断了今生、忘了曾经 提交于 2019-12-22 04:06:34
问题 I am very new to using SearchView . I need a functionality where I have an ActionBar for which I have Search . When I click on Search, the Suggestions should be displayed in a List below the Search field. What I have done so far : Added search in menu.xml and wrote the code in onCreateOptionsMenu() where I initialize the SearchView and setSuggestionsAdapter also implement setOnQueryTextListener . Result: I enter the app, click on search Icon, it shows the suggestions. I type a letter it sorts

Android: How to get search suggestions asynchronously from the web?

北慕城南 提交于 2019-12-21 09:17:06
问题 I have created a searchable activity. Now, i want to add search suggestions that are taken from web service. I want to get those suggestions asynchronously. According to Adding Custom Suggestions I need to override the query method, do my suggestion search, build my own MatrixCursor and return it. but this is the problem, my request for getting the suggestion is an asynchronically one. so when result is back from net it out side of query method's scope. 回答1: Here is an example of SearchView

Autocomplete lists in CKEditor [closed]

怎甘沉沦 提交于 2019-12-18 13:29:09
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I need to add a functionality to my CKEditor to give suggestions to user when he types '#' in document, the suggestions can change on the fly depending on some other fields on the page. please help 回答1: In order to make a suggestion box, you will have to make your custom plugin to

Getting most likely documents of the query using phonetic filter in solr

妖精的绣舞 提交于 2019-12-18 07:15:20
问题 I am using solr for spell checking/ query correction . I have added solr.PhoneticFilterFactory and solr.NGramFilterFactory in fieldType to perform spell checking . It is working fine but here the problem is that I am getting number of documents of the query. I need only most likely words/documents or in similar words, we can say that nearer words/documents to the query . Snippet of schema.xml : <fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100"> <analyzer type=

Android - Prevent text truncation in SearchView suggestions?

三世轮回 提交于 2019-12-17 19:49:21
问题 The suggestions that appear in the default ListView beneath my SearchView contain text that is truncated. I would like the text to be displayed in its entirety (on multiple lines if necessary). I have come up with two possible ways to solve this but, with no examples to be found on the net, I was hoping someone on here may be able to help... Approach #1 / Q1: How can I directly access and modify the appearance of the TextViews that hold the SUGGEST_COLUMN_TEXT_1 and SUGGEST_COLUMN_TEXT_1 text

Grails ElasticSearch Plugin - Suggest Query

♀尐吖头ヾ 提交于 2019-12-13 05:03:37
问题 Is it possible to write a suggest query using the plugin? There's nothing about that in the plugin documentation. If it's possoble, how do I do that? Here's the elasticsearch docs about suggest querys: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters.html http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html Thanks very mutch for the answer. 回答1: Indeed, you do need to send the query directly to Elastic

Elasticsearch search suggestion on array field with partial edge ngram completion

爱⌒轻易说出口 提交于 2019-12-13 03:45:58
问题 I am trying to build a suggester based on arrays of strings in my documents, it is similar to this one but with several differences : the completion suggester from Elasticsearch is not exactly doing what I want (in terms of filtering and prefix matching), as I need an edge ngram that would work on any word of the sentence, accent-insensitive. Let me clarify with an example. Assume I have the following indexed documents. I want to suggest "tags" based on a query q (I don't care about the

AngularJS + UI Bootstrap Typeahead implementation issue

时光怂恿深爱的人放手 提交于 2019-12-12 04:55:42
问题 I am trying to implement Typeahead using my Web Api controller by adopting to this code, that works fine: HTML <div class='container-fluid' ng-controller="TypeaheadCtrl2"> <pre>Model: {{result | json}}</pre> <input type="text" ng-model="result" typeahead="suggestion for suggestion in cities($viewValue)"> </div> Controller in app.js myApp.controller('TypeaheadCtrl2', function ($scope, $http, limitToFilter) { //http://www.geobytes.com/free-ajax-cities-jsonp-api.htm $scope.cities = function