elasticsearch


Elasticsearch highlight complete word instead of query string


i'm trying to implement autocomplete with elasticsearch and yii2 framework. I'm getting the search result but substring highlighting is not working, for example, if I search uni it returns "United States" instead of "United States". Here is the index setting:
'settings' => [
'number_of_shards' => 1,
'analysis' => [
'analyzer' => [
"autocomplete" => [
"type" => "custom",
"tokenizer" => "standard",
"filter" => ["lowercase", "autocomplete_filter"],
],
],
'filter' => [
"autocomplete_filter" => [
"type" => "edge_ngram",
"min_gram" => 2,
"max_gram" => 15,
],
],
],
],
'properties' => [
'id' => ['type' => 'integer'],
'name' => [
'type' => 'string',
"analyzer" => "autocomplete",
"search_analyzer" => "standard",
],
'email' => ['type' => 'string'],
]
Please tell how can I achieve this.

Related Links

Elasticsearch minBy
Snowball analyzer vs language analyzer
AND between tokens in elasticsearch
Elasticsearch Stemmer Override Token Filter not working when usind rules path
Logstash extracting values from sp_executesql
Logstash Grok Modifying and overwriting #timestamp
how to restore elasticsearch.yml config file to original?
Index a graph with ElasticSearch
ElasticSearch query not returning expected results
Fluentd High Availability Custom Index
How do I add an attribute to an Elasticsearch node for the purpose of Shard Allocation Filtering?
Configure ElasticSearch attachment mapper to use OCR plugin
ElasticSearch: How to search for a value in any field, across all types, in one or more indices?
Phrase suggestor - which index and query to act upon
Adding additional fields to ElasticSearch terms aggregation
ElasticSearch multi_match if field exists apply filter otherwise dont worry about it?

Categories

HOME
amazon-web-services
nam
mod-rewrite
generics
stacktrace.js
website
docker-cloud
google-play-services
tcp
liferay-7
sentry
joomla3.2
anchor
mailing-list
azure-logic-apps
bellman-ford
driver
heap-dump
asciimath
susy-sass
string-formatting
error-logging
device
restier
software-packaging
function-points
pubxml
prompt
ipa
morris.js
sap-lumira
openbravo
envoy
monitor
google-play-developer-api
quick-nimble
kendo-listview
winrm
creation
nppexec
subclassing
xvfb
uivisualeffectview
assemblies
reset
swfupload
ejml
spooler
daz3d
deployd
uiautomatorviewer
solr-query-syntax
watir-webdriver
asp.net-web-api-routing
http-basic-authentication
dblink
elastic4s
multi-touch
openquery
data-management
oci
wolfram-language
maven-release-plugin
bbc-micro
odp.net-managed
json-spirit
helm
google-maps-api-2
postal-code
fantom
modern.ie
android-handler
google-gdk
karma-coverage
textscan
fat32
quantify
coding-efficiency
screwturn
forio-contour
preorder
cidr
cpu-time
iosched
armv6
smips
jmenubar
revmob
aero
days
donut-chart
django-filebrowser
cyrillic
cgrectmake
idispatch
android-dialog
sfinae
word-frequency
thejit
image-scanner
acpi
dynamic-c
servercontrol
sql-parametrized-query
azure-acs
resharper-5.1
cleartype
rational-unified-process
fxruby
gtktextview
ntruencrypt
datagridcolumn
acceleration
regioninfo
chronic

Resources

Encrypt Message