Hi,
I know that it is possible to boost documents and fields at indexing time.
But is it possible to boost parts of text inside a field?
I want to index HTML content with Hn and STRONG tags that I would like to
get boosted accordingly.
I could index a structure like:
[{
"value": "Content of a H1 tag",
"boost": 5.0
}, {
"value": "Content of a STRONG tag",
"boost": 2.0
}, {
"value": "Some normal text",
"boost": 1.0
}]
But is there a way to let ES know how to handle this boost parameter?
I have no good idea of doing this inside of elasticsearch on the top of my
head right now. Maybe you could split the tags on indexing in your
application and index into specific fields and boost these fields more on
query time?
Also, when you want to index HTML content, you should actually strip the
HTML before indexing your data, otherwise a tag gets indexed as
the word 'strong' in your search index.
See the html_strip char filter
Hi,
I know that it is possible to boost documents and fields at indexing time.
But is it possible to boost parts of text inside a field?
I want to index HTML content with Hn and STRONG tags that I would like to
get boosted accordingly.
I could index a structure like:
[{
"value": "Content of a H1 tag",
"boost": 5.0
}, {
"value": "Content of a STRONG tag",
"boost": 2.0
}, {
"value": "Some normal text",
"boost": 1.0
}]
But is there a way to let ES know how to handle this boost parameter?
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.