I have the following problem - we need to index some documents by criteria:
a) data in attachments(I use attachment plugin for this)
b) some set of attributes(e.g. country, color)
The search is done by both of them(something like "a document containing
elasticsearch and country=USA"). So my question is if I can create the
following mapping:
curl -X PUT "localhost:9200/search/data/_mapping" -d '{
"attachment" : {
"properties" : {
"file" : {
"type" : "attachment",
"fields" : {
"title" : { "store" : "yes" },
"file" : { "term_vector":"with_positions_offsets", "store":"yes" }
}
}
},
"color" : { "type" : "string" },
"category" : { "type" : "string" }
}
}'
and use one index instead of doing some legwork in application. What I
could not find how to do is:
Update fields separately(especially if I can update the attachment field
with "prepareUpdate")
Perform boolean query on few fields(e.g. attachment field + category)
If it could be done in some other way(but using the same index, because
using few indexes and finding intersections on client-side doesn't seem to
bee a good solution for me)
On Monday, 13 August 2012 18:28:23 UTC+10, Oleg Ievtushok wrote:
Hi,
I have the following problem - we need to index some documents
by criteria:
a) data in attachments(I use attachment plugin for this)
b) some set of attributes(e.g. country, color)
The search is done by both of them(something like "a document containing
elasticsearch and country=USA"). So my question is if I can create the
following mapping:
curl -X PUT "localhost:9200/search/data/_mapping" -d '{
"attachment" : {
"properties" : {
"file" : {
"type" : "attachment",
"fields" : {
"title" : { "store" : "yes" },
"file" : { "term_vector":"with_positions_offsets", "store":"yes"
}
}
}
},
"color" : { "type" : "string" },
"category" : { "type" : "string" }
}
}'
and use one index instead of doing some legwork in application. What I
could not find how to do is:
Update fields separately(especially if I can update the attachment
field with "prepareUpdate")
Perform boolean query on few fields(e.g. attachment field + category)
If it could be done in some other way(but using the same index, because
using few indexes and finding intersections on client-side doesn't seem to
bee a good solution for me)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.