I'm trying to use phrase suggesters against multiple fields. I thought I
could just combine the results of each per-field suggestion but the offset
and length values are all incorrect. The offset is always 0 and the length
is always the length of the original string. This makes it impossible to
combine the results.
Any idea what's wrong with this query that would cause that?
{
"suggest": {
"text": "consipre busines devlopment",
"person_name": {
"phrase": {
"field": "name.suggestion",
"size": 1,
"real_word_error_likelihood": 0.95,
"max_errors": 0.5,
"gram_size": 2,
"direct_generator": [
{
"field": "name.suggestion",
"suggest_mode": "always",
"min_word_length": 1
}
],
"highlight": {
"pre_tag": "",
"post_tag": "</em>"
}
}
},
"person_organization": {
"phrase": {
"field": "organizations.suggestion",
"size": 3,
"real_word_error_likelihood": 0.95,
"max_errors": 0.5,
"gram_size": 2,
"direct_generator": [
{
"field": "organizations.suggestion",
"suggest_mode": "always",
"min_word_length": 1
}
],
"highlight": {
"pre_tag": "",
"post_tag": "</em>"
}
}
},
"person_role": {
"phrase": {
"field": "roles.suggestion",
"size": 3,
"real_word_error_likelihood": 0.95,
"max_errors": 0.5,
"gram_size": 2,
"direct_generator": [
{
"field": "roles.suggestion",
"suggest_mode": "always",
"min_word_length": 1
}
]
}
},
"domain_title_suggestion": {
"phrase": {
"field": "domain_title_suggestion",
"size": 1,
"real_word_error_likelihood": 0.95,
"max_errors": 0.5,
"gram_size": 2,
"direct_generator": [
{
"field": "domain_title_suggestion",
"suggest_mode": "always",
"min_word_length": 1
}
],
"highlight": {
"pre_tag": "",
"post_tag": "</em>"
}
}
},
"domain_suggestion": {
"phrase": {
"field": "domain_suggestion",
"size": 1,
"real_word_error_likelihood": 0.95,
"max_errors": 0.5,
"gram_size": 2,
"direct_generator": [
{
"field": "domain_suggestion",
"suggest_mode": "always",
"min_word_length": 1
}
],
"highlight": {
"pre_tag": "",
"post_tag": "</em>"
}
}
}
}
}
This is the result:
{
"took": 99,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 9,
"max_score": 1,
"hits": [
{
"_index": "conspire_v3",
"_type": "network",
"_id": "1865",
"_score": 1,
"_source": {
"network_id": 12345,
"name": "Battlestar Galactica",
"connectedness": 0,
"node_type": "network",
"node_id": 1865
}
},
{
"_index": "conspire_v3",
"_type": "domain",
"_id": "1874",
"_score": 1,
"_source": {
"count": 1,
"domain": "gmail.com",
"node_type": "domain",
"node_id": 1874
}
},
{
"_index": "conspire_v3",
"_type": "domain",
"_id": "1871",
"_score": 1,
"_source": {
"count": 1,
"domain": "caprica.org",
"node_type": "domain",
"node_id": 1871
}
},
{
"_index": "conspire_v3",
"_type": "person",
"_id": "1876",
"_score": 1,
"_source": {
"name": "Lee Adama",
"connectedness": 0,
"addresses": [
"lee.adama@pegasus.org",
"apollo@galactica.com"
],
"node_type": "person",
"node_id": 1876,
"domains": [
"pegasus.org",
"galactica.com"
],
"domain_suggestion": [
"pegasus.org",
"galactica.com"
]
}
},
{
"_index": "conspire_v3",
"_type": "domain",
"_id": "1879",
"_score": 1,
"_source": {
"count": 1,
"domain": "pegasus.org",
"node_type": "domain",
"node_id": 1879
}
},
{
"_index": "conspire_v3",
"_type": "person",
"_id": "1881",
"_score": 1,
"_source": {
"name": "Bill Adama",
"connectedness": 0,
"addresses": [
"bill.adama@pegasus.org",
"william@galactica.com"
],
"node_type": "person",
"node_id": 1881,
"domains": [
"pegasus.org",
"galactica.com"
],
"domain_suggestion": [
"pegasus.org",
"galactica.com"
]
}
},
{
"_index": "conspire_v3",
"_type": "domain",
"_id": "1868",
"_score": 1,
"_source": {
"count": 4,
"domain": "galactica.com",
"node_type": "domain",
"node_id": 1868
}
},
{
"_index": "conspire_v3",
"_type": "person",
"_id": "1885",
"_score": 1,
"_source": {
"name": "Felix Geta",
"connectedness": 0,
"addresses": [
"geta@galactica.com"
],
"node_type": "person",
"node_id": 1885,
"domains": [
"galactica.com"
],
"domain_suggestion": [
"galactica.com"
]
}
},
{
"_index": "conspire_v3",
"_type": "person",
"_id": "1867",
"_score": 1,
"_source": {
"name": "Kara Thrace",
"connectedness": 1,
"addresses": [
"grumpygirl@gmail.com",
"kara.thrace@caprica.org",
"starbuck@galactica.com"
],
"node_type": "person",
"node_id": 1867,
"domains": [
"gmail.com",
"caprica.org",
"galactica.com"
],
"domain_suggestion": [
"galactica.com"
],
"domain_title_suggestion": [
"Battlestar Galactica"
],
"organizations": [
"Conspire",
"Fake Organization"
],
"roles": [
"Business Development"
]
}
}
]
},
"suggest": {
"domain_title_suggestion": [
{
"text": "consipre busines devlopment",
"offset": 0,
"length": 27,
"options": [
]
}
],
"person_name": [
{
"text": "consipre busines devlopment",
"offset": 0,
"length": 27,
"options": [
]
}
],
"person_organization": [
{
"text": "consipre busines devlopment",
"offset": 0,
"length": 27,
"options": [
{
"text": "conspire busines devlopment",
"highlighted": "<em>conspire<\/em> busines devlopment",
"score": 0.13149868
}
]
}
],
"person_role": [
{
"text": "consipre busines devlopment",
"offset": 0,
"length": 27,
"options": [
{
"text": "consipre business development",
"score": 0.43433
},
{
"text": "consipre busines development",
"score": 0.22576733
},
{
"text": "consipre business devlopment",
"score": 0.22103381
}
]
}
],
"domain_suggestion": [
{
"text": "consipre busines devlopment",
"offset": 0,
"length": 27,
"options": [
]
}
]
}
}
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/c3527bed-da36-4123-8809-7d22800b10a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.