Trying to wrap my head around mapping and wondering how to handle a property that would need to be used for both full and partial matching.
For example, the referrer
property in an apache log.
I want to be able to create searches against this property for both exact matches, or partial matches (let's say so I can find all records coming from the domain in the referrer).
From what I understand, I cannot achieve exact matches with text properties, or partials with keywords.
The only thing I can think of is to create 2 properties, one of each type, but that does not sound very sane.
Any insight on the best approach for this would be appreciated.
Update:
I found this: https://www.elastic.co/blog/strings-are-dead-long-live-strings
So string
stores values as both keyword
and text
. Then I would use referrer:foo
for a text search and referrer.keyword:foo
for an exact match keyword search.
Is that correct?