Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlighting bug where fragments are broken when number_of_fragments is 0 #479

Closed
jessiehernandez opened this issue Nov 5, 2010 · 1 comment

Comments

@jessiehernandez
Copy link

This is happening on version 0.12.1. When highlighting is specified, some of the highlight fields come complete, and some are broken. When those documents are access directly by providing the direct index as "from" and setting "size" as 1, it comes fine: Reproduce code is below (bash script):

curl -XPUT 'http://server:9200/indexname/highbug/_mapping' -d '
{
    "highbug":
    {
        "properties": 
        {

            "body":
            {
                "store": "yes",
                "term_vector": "with_positions_offsets",
                "type": "string"
            },
            "title":
            {
                "store": "yes",
                "term_vector": "with_positions_offsets",
                "type": "string"
            }
        }
    }
}
';

for (( i = 0; i < 20; ++i ))
do
    curl -XPUT "http://server:9200/indexname/highbug/$i" -d "
    {
        \"body\":  \"Test body\",
        \"date\":  \"$(date +%s)\",
        \"title\": \"This is a test on the highlighting bug present in elasticsearch\"
    }";
done

The call below returns the full highlighted fragment for the 1st and 5th results, and the 2nd through 4th results return "hting bug present in elasticsearch" instead of "This is a test on the highlighting bug present in elasticsearch".

curl -XGET 'http://server:9200/indexname/highbug/_search?pretty=true' -d '
{"query":{"query_string":{"query":"bug"}},"from":0,"size":5,"highlight":{"fields":{"title":{"number_of_fragments":0}}}}
';
@kimchy
Copy link
Member

kimchy commented Nov 18, 2010

Highlighting bug where fragments are broken when number_of_fragments is 0, closed by fdb98b1.

medcl pushed a commit to medcl/elasticsearch that referenced this issue Jul 1, 2011
williamrandolph pushed a commit to williamrandolph/elasticsearch that referenced this issue Jun 4, 2020
Remove even more (subtle) warnings
Organize imports

Fix elastic#478 elastic#479
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this issue Oct 2, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants