I think the answer is in the content the content of the synonyms file. For
example if there is an entry in this file that looks like "Binghamton,
Binghamton University", in the end the analyzer is going to produce
something like "b", "bi", ..., "bing", ..., "u", "un", ..., "univ", ... for
a token whose term is "Binghamton". So if you search for "univ", it is
actually going to highlight the "bing" of "Binghamton".
I don't think there is a simple solution to your problem. Since you seem to
be using this index for auto-completion purposes, maybe a better option
would be to not use synonyms in the analyzer but to add a separate document
for every synonym.
On a side note, since you are doing auto-completion, maybe you could have a
look at the completion suggester[1]. Although it doesn't support
highlighting, I would expect it to be an order of magnitude faster than
index-based autocompletion so this might be worth checking out.
{
fields:{
name:SUNY Binghamton University
} highlight:{
name:[
SUNY Binghamton University
]
}
}
{
fields:{
name:Arizona State University
} highlight:{
name:[
Arizona State University
]
}
}
{
fields:{
name:Ohio State University
} highlight:{
name:[
Ohio State University
]
}
}
--
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 elasticsearc...@googlegroups.com.
I think the answer is in the content the content of the synonyms file. For
example if there is an entry in this file that looks like "Binghamton,
Binghamton University", in the end the analyzer is going to produce
something like "b", "bi", ..., "bing", ..., "u", "un", ..., "univ", ... for
a token whose term is "Binghamton". So if you search for "univ", it is
actually going to highlight the "bing" of "Binghamton".
I don't think there is a simple solution to your problem. Since you seem
to be using this index for auto-completion purposes, maybe a better option
would be to not use synonyms in the analyzer but to add a separate document
for every synonym.
On a side note, since you are doing auto-completion, maybe you could have
a look at the completion suggester[1]. Although it doesn't support
highlighting, I would expect it to be an order of magnitude faster than
index-based autocompletion so this might be worth checking out.
{
fields:{
name:SUNY Binghamton University
} highlight:{
name:[
SUNY Binghamton University
]
}
}
{
fields:{
name:Arizona State University
} highlight:{
name:[
Arizona State University
]
}
}
{
fields:{
name:Ohio State University
} highlight:{
name:[
Ohio State University
]
}
}
--
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 elasticsearc...@googlegroups.com.
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.