Searching for a URL

Hi,

I am trying to search for a URL using elastic search, but when I add http:// to the URL it doesn't work. I am using UAX_URL_Email_Tokenizer as the token. I tried with the lowercase token as well, without any luck. How could I fix it?

{
  "mappings" : {
      "service" : {
          "properties" : {
              "title": { "type": "text", "fields": {"raw": {"type": "keyword"}}},
              "linked_items": {
                  "properties" : {
                      "name": {"type": "text", "fields": {"raw": {"type": "keyword"}}},
                      "additional_data": {"type": "text", "analyzer": "url_analyzer", "fields": {"raw": {"type": "keyword"}}}
                  }
              }
          }
      }
  },
  "settings" : {
      "analysis": {
        "filter" : {
          "stopwords_filter" : {
            "type" : "stop",
            "stopwords" : ["http", "https", "www"]
          }
        },
        "analyzer": {
          "url_analyzer": {
            "type": "custom",
            "tokenizer": "uax_url_email",
            "filter": [ "stopwords_filter", "lowercase" ]
          }
        }
      }
    }
}

The search query is:

{
     "query": {
         "query_string": {
             "query": "*https://text.com*",
             "fields": ["title", "linked_items.additional_data"],
                          "default_operator": "AND"
         }
     },
     "size": 300
 }

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.