Synonyms containing commas

When updating a synonym list via the API, not using a synonym text file. We have a synonym list that has values that contain commas causes a json parsing error if the normal escape sequence is used e.g. , Given that the synonyms are a comma separated list, without the escape sequence it makes the list wrong. If I escape the backslash is this the correct approach, ie. \,

What is the correct approach to this problem?

is your synonyms list look like this? or you means your synonyms have commas except the separated comma.

"synonyms": [
"british,english",
"queen,monarch"
]

The original I've have is something like this:
"synonyms": [
"£2\,000 => £2\,000, £2000",
"queen => queen, monarch"
]
However Elastic complains it doesn't recognise the escape sequence. I assumed that if I put in "£2\\,000", that would work, as obviously if I remove the backslash completely it will assume my synonyms are £2 and 000 and £2000; which is clearly not what I need.

i tried with my es6.x and this way get the right answer , "£2\\,000 => £2\\,000, £2000"
it 's exactly what you want.

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