elasticsearch


Mappings on filed Elastic Search


I am using elastic search for autocompletion and also to correct spelling mistakes.I have this mapping for my field(for auto-completion).
**Mapping:**
"name": {
"type": "text",
"analyzer": "autocomplete"
}
Now i want to implement phrase suggester on this field.When i use this it is giving wrong result.Thats because of existing mapping i think.
**POST XYZ/_search**
{
"suggest": {
"text": "ipone 16",
"simple_phrase": {
"phrase": {
"field": "name",
"highlight": {
"pre_tag": "<em>",
"post_tag": "</em>"
}
}
}
}
}
**Results:**
"options": [
{
"text": "i ip ipo iphon iphone 1 16",
"highlighted": "i ip ipo <em>iphon iphone</em> 1 16",
"score": 1.6111489e-8
},
{
"text": "i ip ipo iphon iphon 1 16",
"highlighted": "i ip ipo <em>iphon iphon</em> 1 16",
"score": 1.4219211e-8
},
{
"text": "i ip ipo ipho iphone 1 16",
"highlighted": "i ip ipo <em>ipho iphone</em> 1 16",
"score": 1.3510152e-8
},
{
"text": "i ip ipo ipho iphon 1 16",
"highlighted": "i ip ipo <em>ipho iphon</em> 1 16",
"score": 1.1923397e-8
},
{
"text": "i ip ipo iron iphone 1 16",
"highlighted": "i ip ipo <em>iron iphone</em> 1 16",
"score": 6.443544e-9
}
]
**From the document i should use this for phrase suggester.**
"mappings": {
"test": {
"properties": {
"title": {
"type": "text",
"fields": {
"trigram": {
"type": "text",
"analyzer": "trigram"
},
"reverse": {
"type": "text",
"analyzer": "reverse"
}
}
}
}
**How can i use two different mapping on same filed?**
As your results are not tokenized properly the problem could be from
your aurocomplete analyzer. please provide your _settings to see the
defination for your analyzers.
Do Your query on name.trigram.
After solving this problem it's good to prune your result using collate

Related Links

How can I sort by a value of a “nested” Hash in Elasticsearch
Add custom field type to ElasticSearch
Issue with document type name containing special characters - elasticsearch
ElasticSearch ignoring sort when filtered
elastic search ngram special characters
ElasticSearch multi indexes effect on performance + Tire default config
Exact (not substring) matching in Elasticsearch
Is a geo_distance query with linestring or multipolygon geo type possible?
After indexing file how to extract properties of file such as:-file type,name etc. by elasticsearch
how to filter facet to show only specific terms
How to search using keyword analyzer on Elastic Search?
Only index certain fields from Wikipedia River
How do I setup a 1:N workflow with filters in Logstash?
boost the score relative to term location in field elasticsearch
Elasticsearch range query for string
is there a way to boost matches in long documents in elasticsearch

Categories

HOME
cocoapods
amazon-web-services
android-espresso
mc
svn
blast
apple-push-notifications
clearcase
activemq
braintree
initialization
gallery
share
google-search-console
supercollider
wine
solution
tiff
asp.net-core-1.0
google-tasks-api
gmp
nose
infrared
neo4j.rb
backtracking
liferay-6.2
conda
mime-types
sybase-ase
perfino
dragula
multi-dimensional-scaling
list-comprehension
tortoisehg
annotation-processing
snap-framework
rspec-rails
advanced-filter
counting
nest
serversocket
love2d
code-rally
nanogallery
robust
spooler
type-inference
docker-ucp
ipp-protocol
music21
knockout-2.0
visual-format-language
skip-lists
simple-schema
scala-collections
portability
emacs25
swiperefreshlayout
pecl
d3v4
dcount
always-on-top
mathml
noclassdeffounderror
strpos
maximize
vim-plugin
fanotify
mixins
sqlbase
green-threads
relational-model
tidyr
kognitio-wx2
createfile
dos2unix
quantify
csslint
code-complexity
meteor-collections
jomsocial
iosched
spring-security-acl
smips
quickgraph
form-for
days
jbox2d
django-filebrowser
significant-digits
ip-geolocation
arrow
cakeyframeanimation
uipangesturerecognizer
nsfont
dynamic-c
office-automation
printqueue
self-tracking-entities
eventaggregator
jquery-effects
efs
suggestbox
html-generation

Resources

Encrypt Message