elasticsearch


elasticsearch : merge 2 fields from different types in search result


Do you know if we can merge dynamically 2 fields which belong to different types in one unique field
I have an index my_index with 2 types type1 and type2
I am doing a search on those 2 types :
POST /my_index/_search
{
"min_score": 1,
"query": {
"bool": {
"should": [
{
"match": {
"titreType1": {
"query": "boy"
}
}
},
{
"match": {
"titreType2": {
"query": "boy"
}
}
}
]
}
}
}
I will have results from the 2 different types that looks like to:
"hits": [
{
"_index": "my_index",
"_type": "type1",
"_id": "AVo0LhFj8N13TOVDqMo9",
"_score": 13.171456,
"_source": {
"titreType1": "the boy !"
}
},
{
"_index": "my_index",
"_type": "type1",
"_id": "AVo0Lg5X8N13TOVDqMUH",
"_score": 12.986091,
"_source": {
"titreType1": "if i were a boy"
}
},
{
"_index": "my_index",
"_type": "type2",
"_id": "AVo0S-nM8N13TOVDqNPX",
"_score": 12.34135,
"_source": {
"titreType2": "boy are very nasty and it is sad"
}
},
...
]
I would like to have in my result just one column named "title" that display value from titreType1 or titreType2
Do you know how to do this?

Related Links

Couch Db - indexing and searching
ElasticsearchIllegalStateException[[index.version.created] is not present in the index settings for index with uuid: [null]]
Join two separate nodes into one cluster?
Elasticsearch - combining query_string and bool query in filter
Issue while querying on a field that store a file path on ElasticSearch
elasticsearch/logstash and logstash-contrib: Couldn't find any plugin named 'x'
What is the difference between Lucene and Elasticsearch
Cannot create Phoenix JDBC river in Elasticsearch
Disabling field analyzing by default in elastic search
time difference in elasticsearch took and that calculated manually
elasticsearch comparison between fields
Find all ID where ID are not in my blacklist
How to order results by custom value and then by _score
Kibana homepage shows blank after deleting all indices
elasticsearch: update in a nested object (HTTP)
Using Phoenix to help to integrate elastic-search and Hbase. When use sqlline.py,to create table, bad happens

Categories

HOME
visual-studio
nam
android-studio
schema.org
opencv-python
activex
out-of-memory
bing-search
iptables
ontology
hyperledger
turbojpeg
angular-meteor
onvif
lc3
getopenfilename
parsley.js
amazon-emr
erd
tiff
trace32
distributed-computing
django-rq
temperature
reselect
asciimath
jqxgrid
jaspersoft-studio
cloudsim
spring-shell
libgit2
akka-persistence
kamailio
webviewclient
php-5.3
code-climate
bitbake
audit
monitor
private-key
osx-lion
fastlane
ng-repeat
reset
best-buy-api
grunt-contrib-watch
google-prediction
httphandler
type-inference
vesta
daz3d
swift2.3
libreoffice-writer
solr-query-syntax
dex
msxml
front-camera
openerp-6
clp
pyaudio
powerpoint-2013
adjacency-list
swiffy
xcopy
m4
juniper-network-connect
variable-length-array
dsa
pythonxy
sqlbase
wlanapi
supersocket.net
com0com
html-escape-characters
kognitio-wx2
device-admin
global-scope
smacss
qt5.4
thruway
wso2bam
usb-flash-drive
sensormanager
discovery
san
tnt4j
postgres-xc
red-system
cgrectmake
multiple-dispatch
idispatch
groovy-console
asp.net-mvc-views
bass
3-tier
uninstaller
facebook-fbml
spring-modules
stretchblt

Resources

Encrypt Message