search-suggestion

Android SearchRecentSuggestions - suggestions do not get displayed when typing in SearchView

时光毁灭记忆、已成空白 提交于 2019-12-05 09:47:20
问题 I have a working search widget and want to add search history suggestions. I followed the Android tutorial (http://developer.android.com/guide/topics/search/adding-recent-query-suggestions.html), and while the search still works, no suggestions are being displayed. Here is my code: Content provider package com.mypackage; import android.content.SearchRecentSuggestionsProvider; public class SearchHistoryProvider extends SearchRecentSuggestionsProvider { public final static String AUTHORITY =

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

北城以北 提交于 2019-12-05 03:25:46
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": [ { "options": [ { "text": "invalid", "_source": { "post_hashtags": [ "invalid" ] } }, { "text":

SearchView Filtering and Set Suggestions

大城市里の小女人 提交于 2019-12-05 02:52:10
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 out the matched ones. I type 2nd letter it shows no suggestions. Also I close the searchview and open

How to delete elastic search indices periodically?

别等时光非礼了梦想. 提交于 2019-12-04 21:42:51
I have created indices on daily basis to store the search history and i am using those indices for the suggestions in my applciation, which helps me to suggest based on history as well. now i have to maintain only last 10 days of history. So is there any feature in Elastic search that allows me to create and delete indices periodically? The only thing I can think of is using data math: https://www.elastic.co/guide/en/elasticsearch/reference/current/date-math-index-names.html In sense you can do this: DELETE <logs-{now%2Fd-10d}> This does not work nice in curl though due to url encoding. You

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

限于喜欢 提交于 2019-12-04 02:53:45
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. Here is an example of SearchView with suggestions coming from a network service (I used Retrofit): @Override public boolean

Android SearchRecentSuggestions - suggestions do not get displayed when typing in SearchView

随声附和 提交于 2019-12-03 22:21:42
I have a working search widget and want to add search history suggestions. I followed the Android tutorial ( http://developer.android.com/guide/topics/search/adding-recent-query-suggestions.html ), and while the search still works, no suggestions are being displayed. Here is my code: Content provider package com.mypackage; import android.content.SearchRecentSuggestionsProvider; public class SearchHistoryProvider extends SearchRecentSuggestionsProvider { public final static String AUTHORITY = SearchHistoryProvider.class.getName(); public final static int MODE = DATABASE_MODE_QUERIES; public

android search: customize suggestion layout

柔情痞子 提交于 2019-12-03 08:49:14
问题 I've been following along with the directions here for both SearchView and dialog implementations. Both are visible below. There are many questions on SO that focus on customizing the search box, but few that are about customizing the UI of the suggestions. (The ones that do are about color/font, the defaults for which are fine for me.) I would like to be able to widen the suggestions to take up the whole width of the screen. Is there any way to customize the width using either dialog or

Elasticsearch completion suggest search with multiple-word inputs

心不动则不痛 提交于 2019-12-03 07:01:13
Using the Elasticsearch completion suggester I have problems returning multi-word input suggestions matching a one-word query. Example structure: PUT /test_index/ { "mappings": { "item": { "properties": { "test_suggest": { "type": "completion", "index_analyzer": "whitespace", "search_analyzer": "whitespace", "payloads": false } } } } } PUT /test_index/item/1 { "test_suggest": { "input": [ "cat dog", "elephant" ] } } Working query: POST /test_index/_suggest { "test_suggest":{ "text":"cat", "completion": { "field" : "test_suggest" } } } with result { "_shards": { "total": 5, "successful": 5,

android search: customize suggestion layout

安稳与你 提交于 2019-12-02 22:46:45
I've been following along with the directions here for both SearchView and dialog implementations. Both are visible below. There are many questions on SO that focus on customizing the search box, but few that are about customizing the UI of the suggestions. (The ones that do are about color/font, the defaults for which are fine for me.) I would like to be able to widen the suggestions to take up the whole width of the screen. Is there any way to customize the width using either dialog or SearchView implementations. I'd prefer not to use a library unless that is the only option. If this is

Sphinx and “did you mean … ?” suggestions idea. WIll it work?

落花浮王杯 提交于 2019-12-01 17:47:35
I'm trying to come up with the fastest way to make search suggestions. At first I thought a Levenstein UDF function combined with a mysql table would do the job. But using levenshtein, mysql would have to go over every row in the table (tons of words) which would make the query really slow. Now I recently installed and started to use Sphinx (http://sphinxsearch.com/) for fulltext searching mainly because of its performance and tight mysql integration with SphinxSE. So I asked myself if I can implement a "did you mean" algorithm using sphinx to boost performance somehow, and I think I found a