Rg: attachment highlighting

hi, i create a index like below

curl -XPUT 'http://localhost:9200/testindex11/' -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
}
}
}'

and i mapped it like below

curl -XPUT localhost:9200/testindex11/testmap/_mapping -d '
{
"testmap": {
"properties" : {
"files" : { "type" : "attachment",
"content" : { "term_vector":"with_positions_offsets","store":"yes" } }
}
}
}
'

and i stored the data like below

curl -XPUT localhost:9200/testindex11/testmap/1 -d '
{
"files" : [
{
"_content_type" : "application/pdf",
"_name" : "/home/fstl/Documents/200302L045.pdf",
"content" : "BASE64 ENCODED STRING OF PDF/XML/...."
}
]
}'

and i searched like below

curl -XGET 'http://localhost:9200/testindex11/_search?pretty=true' -d
'
{
"query" : {
"term" : { "files": "bhavani" }
},"highlight" : {
"fields" : {
"files" : { "content" : {} }
}
}
}'

but i am not getting the highlighted results, just getting content in
base64 format.

so what i can do to get the results along with highlighted results?

Hi,

Here you can find complete attachment example

Now with highlighting too.

HTH,

Regards,
Lukas

On Tue, Jul 12, 2011 at 3:44 PM, Bhavani Krishna kbkrishnacse@gmail.comwrote:

hi, i create a index like below

curl -XPUT 'http://localhost:9200/testindex11/' -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
}
}
}'

and i mapped it like below

curl -XPUT localhost:9200/testindex11/testmap/_mapping -d '
{
"testmap": {
"properties" : {
"files" : { "type" : "attachment",
"content" : { "term_vector":"with_positions_offsets","store":"yes" } }
}
}
}
'

and i stored the data like below

curl -XPUT localhost:9200/testindex11/testmap/1 -d '
{
"files" : [
{
"_content_type" : "application/pdf",
"_name" : "/home/fstl/Documents/200302L045.pdf",
"content" : "BASE64 ENCODED STRING OF PDF/XML/...."
}
]
}'

and i searched like below

curl -XGET 'http://localhost:9200/testindex11/_search?pretty=true' -d
'
{
"query" : {
"term" : { "files": "bhavani" }
},"highlight" : {
"fields" : {
"files" : { "content" : {} }
}
}
}'

but i am not getting the highlighted results, just getting content in
base64 format.

so what i can do to get the results along with highlighted results?

Great !

I suggest creating a pull request to add an example chapter (or a Faq) to share it with the whole ES community.

Is there any place in the site where it can be put (tutorial ?)

David :wink:

Le 12 juil. 2011 à 16:52, Lukáš Vlček lukas.vlcek@gmail.com a écrit :

Hi,

Here you can find complete attachment example Test of attachments plugin · GitHub
Now with highlighting too.

HTH,

Regards,
Lukas

On Tue, Jul 12, 2011 at 3:44 PM, Bhavani Krishna kbkrishnacse@gmail.com wrote:
hi, i create a index like below

curl -XPUT 'http://localhost:9200/testindex11/' -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
}
}
}'

and i mapped it like below

curl -XPUT localhost:9200/testindex11/testmap/_mapping -d '
{
"testmap": {
"properties" : {
"files" : { "type" : "attachment",
"content" : { "term_vector":"with_positions_offsets","store":"yes" } }
}
}
}
'

and i stored the data like below

curl -XPUT localhost:9200/testindex11/testmap/1 -d '
{
"files" : [
{
"_content_type" : "application/pdf",
"_name" : "/home/fstl/Documents/200302L045.pdf",
"content" : "BASE64 ENCODED STRING OF PDF/XML/...."
}
]
}'

and i searched like below

curl -XGET 'http://localhost:9200/testindex11/_search?pretty=true' -d
'
{
"query" : {
"term" : { "files": "bhavani" }
},"highlight" : {
"fields" : {
"files" : { "content" : {} }
}
}
}'

but i am not getting the highlighted results, just getting content in
base64 format.

so what i can do to get the results along with highlighted results?

Yea, may be a tiny tutorial page about attachments would be nice.

Lukas

On Tue, Jul 12, 2011 at 5:04 PM, David Pilato david@pilato.fr wrote:

Great !

I suggest creating a pull request to add an example chapter (or a Faq) to
share it with the whole ES community.

Is there any place in the site where it can be put (tutorial ?)

David :wink:

Le 12 juil. 2011 à 16:52, Lukáš Vlček lukas.vlcek@gmail.com a écrit :

Hi,

Here you can find complete attachment example https://gist.github.com/1075067
Test of attachments plugin · GitHub
Now with highlighting too.

HTH,

Regards,
Lukas

On Tue, Jul 12, 2011 at 3:44 PM, Bhavani Krishna <kbkrishnacse@gmail.com
kbkrishnacse@gmail.com> wrote:

hi, i create a index like below

curl -XPUT ' http://localhost:9200/testindex11/
http://localhost:9200/testindex11/' -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
}
}
}'

and i mapped it like below

curl -XPUT localhost:9200/testindex11/testmap/_mapping -d '
{
"testmap": {
"properties" : {
"files" : { "type" : "attachment",
"content" : { "term_vector":"with_positions_offsets","store":"yes" } }
}
}
}
'

and i stored the data like below

curl -XPUT localhost:9200/testindex11/testmap/1 -d '
{
"files" : [
{
"_content_type" : "application/pdf",
"_name" : "/home/fstl/Documents/200302L045.pdf",
"content" : "BASE64 ENCODED STRING OF PDF/XML/...."
}
]
}'

and i searched like below

curl -XGET ' http://localhost:9200/testindex11/_search?pretty=true
http://localhost:9200/testindex11/_search?pretty=true' -d
'
{
"query" : {
"term" : { "files": "bhavani" }
},"highlight" : {
"fields" : {
"files" : { "content" : {} }
}
}
}'

but i am not getting the highlighted results, just getting content in
base64 format.

so what i can do to get the results along with highlighted results?

Thanks..it solved my problem

On Jul 12, 7:52 pm, Lukáš Vlček lukas.vl...@gmail.com wrote:

Hi,

Here you can find complete attachment examplehttps://gist.github.com/1075067
Now with highlighting too.

HTH,

Regards,
Lukas

On Tue, Jul 12, 2011 at 3:44 PM, Bhavani Krishna kbkrishna...@gmail.comwrote:

hi, i create a index like below

curl -XPUT 'http://localhost:9200/testindex11/'-d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
}
}
}'

and i mapped it like below

curl -XPUT localhost:9200/testindex11/testmap/_mapping -d '
{
"testmap": {
"properties" : {
"files" : { "type" : "attachment",
"content" : { "term_vector":"with_positions_offsets","store":"yes" } }
}
}
}
'

and i stored the data like below

curl -XPUT localhost:9200/testindex11/testmap/1 -d '
{
"files" : [
{
"_content_type" : "application/pdf",
"_name" : "/home/fstl/Documents/200302L045.pdf",
"content" : "BASE64 ENCODED STRING OF PDF/XML/...."
}
]
}'

and i searched like below

curl -XGET 'http://localhost:9200/testindex11/_search?pretty=true'-d
'
{
"query" : {
"term" : { "files": "bhavani" }
},"highlight" : {
"fields" : {
"files" : { "content" : {} }
}
}
}'

but i am not getting the highlighted results, just getting content in
base64 format.

so what i can do to get the results along with highlighted results?