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

Elasticsearch Completion Suggester - Sort suggestions
Can _score from different queries be compared?
Difference between a “plain” terms query and a terms query using a filter
Elasticsearch: Updating a field that has been set as a document _id via mapping with a path
Return parent data with child document from Elasticsearch
Elasticsearch Giving Incorrect Result When Using “must_not” operator alongwith “must” Operator
ElasticSearch _suggest queries are case sensitive. Want them to be case insensitive
How to normalize periods in elastic search query (such that JJ Abrams == J.J Abrams)?
Elastic Search - Sort By Doc Type
ElasticSearch Filtering aggregations from array field
Full text search for exact match_phrase (with leading and trailing whitespace) in elasticsearch
Do two equal documents in elasticsearch double the needed disc space
In logstash/ElasticSearch/Kibana, how do I augment records following a particular stateful request?
How to know which shard is overloaded in Elasticsearch?
ElasticSearch - searching different doc_types with the same field name but different analyzers
ELK Type Conversion - Not a number but a string

Categories

HOME
qt
memory
yahoo-weather-api
enums
transactions
foaf
website
android-emulator
docker-cloud
openflow
repair
capistrano
position
mithril.js
firebase-database
yahoo
scrape
rangy
orc
xbap
susy-sass
multiple-tables
gitkraken
dashdb
neo4j.rb
connection-refused
websphere-portal
pdf.js
unordered-multimap
uri
jackrabbit-oak
sales
john-the-ripper
epplus
cucumber-junit
osx-lion
mongoengine
cloudera-manager
kendo-listview
transform
subclassing
nanogallery
forms-authentication
assert
swfupload
plane
cloudera-sentry
hypothesis-test
dagger
1wire
yoast
transparency
cyanogenmod
sonicmq
nusoap
sequence-diagram
gtk#
finder
pbx
mifos
xcode6.4
pyaudio
seccomp
fragmentstatepageradapter
deferred-rendering
cortana
bayesglm
html.actionlink
nastran
apple
libz
replicaset
swagger-maven-plugin
textscan
quercus
mathematical-expressions
ssmtp
fasterxml
qt5.4
nidaqmx
rails-api
proxy-server
cloo
illuminate-container
frontbase
unicoins
rikulo
arel
asp.net-mvc-3-areas
android-authenticator
cyrillic
android-dialog
server-name
opends
algol68
representation
database-deadlocks
space-partitioning
digiflow
solandra
uninstaller
odac
gui-designer
chronic

Resources

Encrypt Message