Dr Jay
Dr Jay

Reputation: 425

Solr schema-browser hyphen escaped problem

Hello there i'm trying to get the list of the imported field Movie_name

How ever the hyphen was escaped and not showing like this img example enter image description here

And this the data i attached already

enter image description here

Like you see two data with the Movie_name
        "Movie_name":"sci-Fi2"},
        "Movie_name":"sci-Fi"}]

What i'm trying to do is a simple analytics & get all the list of names with the field Movie_name and not the data. So the question why the hyphen are escaped in the schema-browser Why i cannot get the exactly correct field name ???

Upvotes: 0

Views: 69

Answers (1)

MatsLindh
MatsLindh

Reputation: 52862

It's not being escaped - what you're seeing in the schema browser are the actual terms stored in the index (what is usually referred to as "tokens"). If you want these to be preserved in the original form (i.e. as a single token) to be used for faceting or analytics, store them as the type string instead of as a text based field (which have a tokenizer attached - and that tokenizer usually splits the string into multiple smaller tokens on natural split points, such as -).

In your example, sci-fi is turned into sci and fi. If you use a string type, or a KeywordTokenizer, the input is kept as it is, and the token is stored as sci-fi instead.

Upvotes: 2

Related Questions