Sign "+" was treated as wildcard in Elasticsearch API GET Search

I was trying to access my Elasticsearch topic with API GET. please see below sample query.
https://localhost:9200/my_topic/_search?pretty&q=trade.tradeType:"Delta +1"
The problem with this search is that the result returned is not only trade type of "Delta +1", but also "Delta -1" and some others. Due to this output I receive, I suspect that "+" is actually treated as an wildcard in this search.
I would really appreciate if someone can let me know what I should modify in order to receive the correct search result.
Please note, below two attempts got zero results back for me, tradeType field is mapped as TEXT as primary type and Keyword as secondary type.

https://localhost:9200/my_topic/_search?pretty&q=trade.tradeType.keyword:"Delta +1"
https://localhost:9200/my_topic/_search?pretty&q=trade.tradeType.keyword:Delta +1

I suspect you are using the default analyzer. When you index "delta +1" you have the tokens "delta" and "1", the "+" character is ignored. If you need to index that character you need another analyzer.

I can query and receive correct result if I use Elasticsearch DSL with POST payload as below. ".keyword" will resolve all my problem.

{
	"term": {
		"trade.tradeType.keyword": "Delta +1"
	}
}

My issue is that I cannot reproduce the same with Elasticsearch API using GET command.

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