gbif / portal-feedback

User feedback for the GBIF API, website and published data. You can ask questions here. 🗨❓
30 stars 16 forks source link

slash character not working in resource search #190

Closed gbif-portal closed 7 years ago

gbif-portal commented 7 years ago

slash character not working in resource search

I often search for DOIs e.g 10.1002/cpe.4137, but now I get an error. Seems the slash charecter is interpreted as a ~, probably needs escaping or something.


fbitem-ed6cd123cf3a3ca6ba222d90684fb8f4ea8d17bb Reported by: @dnoesgaard System: Chrome 57.0.2987 / Mac OS X 10.12.4 Referer: https://demo.gbif.org/resource/search?q=10.1002~2Fcpe.4137&contentType=literature Window size: width 1743 - height 943 API log&_a=(columns:!(request,response,clientip),filters:!(),index:'prod-varnish-',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'response:%3E499%20AND%20(request:%22%2F%2Fapi.gbif.org%22)')),sort:!('@timestamp',desc))&indexPattern=uat-varnish-&type=histogram) Site log&_a=(columns:!(request,response,clientip),filters:!(),index:'prod-varnish-',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'response:%3E399%20AND%20(request:%22%2F%2Fdemo.gbif.org%22)')),sort:!('@timestamp',desc))&indexPattern=uat-varnish-&type=histogram)

MortenHofft commented 7 years ago

@fmendezh Looks like there is encoding issues - this is what the query look slike that fails

{
    "query": {
        "bool": {
            "must": [
                {
                    "query_string": {
                        "query": "10.1002/cpe.4137"
                    }
                }
            ]
        }
    }
}

error:

{
        "shard": 0,
        "index": "project1496744810341",
        "node": "0WgUH8ndSO2Cu8k0mlTzBQ",
        "reason": {
          "type": "query_shard_exception",
          "reason": "Failed to parse query [10.1002/cpe.4137]",
          "index_uuid": "_cAeRus0THKvmA2tQqrakg",
          "index": "project1496744810341",
          "caused_by": {
            "type": "parse_exception",
            "reason": "Cannot parse '10.1002/cpe.4137': Lexical error at line 1, column 17.  Encountered: <EOF> after : \"/cpe.4137\"",
            "caused_by": {
              "type": "token_mgr_error",
              "reason": "Lexical error at line 1, column 17.  Encountered: <EOF> after : \"/cpe.4137\""
            }
          }
        }
      }
MortenHofft commented 7 years ago

it now works https://demo.gbif.org/resource/search?q=10.1002~2Fcpe.4137&contentType=literature