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

file:/// url exception #22

Open
khoan opened this issue Apr 10, 2017 · 0 comments
Open

file:/// url exception #22

khoan opened this issue Apr 10, 2017 · 0 comments

Comments

@khoan
Copy link

khoan commented Apr 10, 2017

I'm on es 1.7. Things blows up on file:/// URI.

$ curl -XPUT bam -d '
{
  "settings": {
    "analysis": {
      "tokenizer": {
        "url_full": {
          "type": "url",
          "allow_malformed": true
        }
      },
      "analyzer": {
        "url_full": {
          "tokenizer": "url_full"
        }
      }
    }
  },
  "mappings": {
    "events": {
      "properties": {
       "url": {
        "type": "string",
        "analyzer": "url_full"
      } 
      }
    }
  }
}'

# blows up on file:///
$ curl 'localhost:9200/bam/_analyze?analyzer=url_full&pretty' -d 'file:///escape/path/to/dream'
{
  "error" : "IllegalArgumentException[startOffset must be non-negative, and endOffset must be >= startOffset, startOffset=-1,endOffset=6]",
  "status" : 500
}

# fine for file://
$ curl 'localhost:9200/logs/_analyze?analyzer=url_full&pretty' -d 'file://operabar/escape-two'
{
  "tokens" : [ {
    "token" : "file",
    "start_offset" : 0,
    "end_offset" : 4,
    "type" : "protocol",
    "position" : 1
  }, {
    "token" : "operabar",
    "start_offset" : 7,
    "end_offset" : 15,
    "type" : "host",
    "position" : 2
  }, {
    "token" : "/escape-two",
    "start_offset" : 15,
    "end_offset" : 26,
    "type" : "path",
    "position" : 3
  }, {
    "token" : "-1",
    "start_offset" : 0,
    "end_offset" : 0,
    "type" : "port",
    "position" : 4
  }, {
    "token" : "file://operabar/escape-two",
    "start_offset" : 0,
    "end_offset" : 26,
    "type" : "whole",
    "position" : 5
  }, {
    "token" : "operabar:-1",
    "start_offset" : 0,
    "end_offset" : 0,
    "type" : "whole",
    "position" : 6
  }, {
    "token" : "file://operabar",
    "start_offset" : 0,
    "end_offset" : 15,
    "type" : "whole",
    "position" : 7
  } ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant