Query a special character

Hi

I have place the same question in the kibana section but after searching more deeply I suppose that is a problem whit the DB.

(like this old thread for example : https://discuss.elastic.co/t/problem-with-single-quote-mark-in-json/3734/3b )

I must search the character ' (single quote) from a string (only the single quote) but when I try so search it I don't receive any response, it's like I place an empty query.
Also I don't receive sort of error back...

I have already try to use the UTF-8 code and a regex... No match and also no error.

Any suggestion? Is it possible or not?

Thank you

Hi,

Two questions:
How are you indexing your data?
Have you defined a mapping for the field you are searching on for the single quote? If so, what analyzer do you use for that field?

Hi and thank you for your reply.

Meanwhile I have buy the elasticsearch manual and I tried to solve to fix the problem my myself.
I'm using the standard analyzer so, for this reason, I cannot search for special character because the filter "delete" them from the search.

Also any other standard filter seems don't fit my needs (if I'm not wrong) so the only solution is to create a custom analyzers I suppose.

What I don't understand very well instead is if I can modify the existing index adding custom analyzers or I must delete the existing one and recreate it from the begin...
The second option sound really strange to me, but is what I understand until now from the manual.
Also because I don't need a huge filter, I need only to search the single quote from a single field (for now at least).

Hi Giulio,
glad you found a solution. Unfortunately you are right, you cannot add a new analyzer for existing fields to an index. The reason for this is that the data in that field was already indexed with a different analyzer, and having data in the same field that was analyzed in two different ways leads to unpredictable search, so thats why you need to index your data again if you change the analyzer.

Thank you for your explanations.
I will try to create something that allow me to research what I want.

The most easy way (and also quite raw...) is force elasticsearch to modify the single quote in a string of text that allow me to easily find them without touching other parameters

...
"char_filter" : {
" '_to_SOME_SORT_OF_STRING": {
"type" : "mapping",
"mappings": [ " '=> :SOME_SORT_OF_STRING:"]
}
"tokenizer" : {...standard setting...}
"filter" : {...standard setting...}
"analyzer" : {...standard setting...}
}

In this way, without touching anything else of the standard configuration I will be able to find the string that in the original message was a single quote.

Is this totally crazy or can work?