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
Elasticsearch Highlighting problem (0.90.1) #3200
Comments
can you provide a full gist that reproduces this problem? |
Elasticsearch Highlighting problem (0.90.1) I am working on upgradion of elasticsearch from 0.20.2 to 0.90.1 and come across the following issue. Steps to reproduce the issue Environment: Step 1:- http://localhost:9200/test_hightlight [POST] { Step2:
Step3: URL:http://localhost:9200/test_hightlight/ { Got the following error {
} Note: The same query is working as we expected with Elasticsearch 0.20.2 |
Hi s1monw, |
The JSON looks invalid: "pattern": "," should be replaced by either "pattern": "," or "pattern": ",". I tried with both options and didn't manage to reproduce the issue with 0.90.1. Could you provide us with a bash script containing a set of curl commands that always reproduce the problem? |
Delete previous testscurl -XDELETE 'http://127.0.0.1:9200/test_hightlight/?pretty=1' Step 1:-Defined mappings and settings for index(test_hightlight)/type(hightlight).curl -XPUT 'http://127.0.0.1:9200/test_hightlight/?pretty=1' -d ' Step2:Indexed following documents to newly created Index.curl -X POST 'http://localhost:9200/test_hightlight/hightlight/1001' -d ' #Step3: Got the following error {
} |
When using PlainHighlighter, TokenStreams are resetted both before highlighting and at the beginning of highlighting, causing issues with analyzers that read in reset() such as PatternAnalyzer. This commit removes the call to reset which was performed before passing the TokenStream to the highlighter. Close #3200
@kuttiKumarv Thanks for the detailed steps, I managed to reproduce the issue and fix it! |
When using PlainHighlighter, TokenStreams are resetted both before highlighting and at the beginning of highlighting, causing issues with analyzers that read in reset() such as PatternAnalyzer. This commit removes the call to reset which was performed before passing the TokenStream to the highlighter. Close elastic#3200
I am working on upgradion of elasticsearch from 0.20.2 to 0.90.1 and come across the following issue.
Elasticsearch Highlighting was working fine(getting results as we expected) in 0.20.2, but the same doesn’t work in ES 0.90.1 "type": "pattern",
Steps to reproduce the issue
Environment:
JDK 1.7,Windows 7, elasticsearch 0.90.1, used elasticsearch head plugin to create/query documents
Step 1:-
Defined mappings and settings for index(test_hightlight)/type(hightlight).
http://localhost:9200/test_hightlight [POST]
{
"settings": {
"index": {
"number_of_shards": 6,
"number_of_replicas": 2,
"analysis": {
"analyzer": {
"CommaAnalyzer": {
"type": "pattern",
"flags": "DOTALL",
"lowercase": "true",
"pattern": ",",
"stopwords": "none"
}
}
}
}
},
"mappings": {
"hightlight": {
"properties": {
"documentName": {
"analyzer": "CommaAnalyzer",
"type": "string"
},
"description": {
"analyzer": "CommaAnalyzer",
"type": "string"
}
}
}
}
}
Step2:
Indexed following documents to newly created Index.
Step3:
Executed the following query
URL:http://localhost:9200/test_hightlight/
Query:
{
"timeout": 60000,
"query": {
"bool": {
"must": {
"query_string": {
"query": "business",
"default_operator": "and"
}
}
}
},
"explain": false,
"highlight": {
"pre_tags": [
""
],
"post_tags": [
""
],
"fields": {
"documentName": {
"fragment_size": 20,
"number_of_fragments": 5,
"fragment_offset": 0
}
}
}
}
Got the following error
{
}
Note: The same query is working as we expected with Elasticsearch 0.20.2
The text was updated successfully, but these errors were encountered: