elasticsearch grammar learning

Syntax demo:

PUT es-demo 
{
    "settings":{
        "number_of_shards":5,
        "number_of_replicas":1
    },
    "mappings":{
        "TypeName":{
            "dynamic":"strict",
            "properties":{
                "title":{
                        "type":"string",
                        "store":"yes",
                        "index":"analyzed",
                        "analyzer": "ik_max_word",
                        "search_analyzer": "ik_max_word"
                    }
            }
        }
    }
}

 

type field type, all fields are set to get string, because the query and the encoding process, some types can not be converted well, such as boolean. can
type type can be (text, long, short, date , integer , object, etc.)
whether store to store, there is property yes or no, whether that property will be stored, but if set to no, when the query is unable to use this property as a query terms, based on business expansion and easy maintenance, it is recommended use yes
index if the index attributes not_analyzed (word without analysis), analyzed (word analysis), no (no analysis regardless of the word)
which word breaker analyzer used in the installation es will install their own word, such as IK tokenizer in this use of the word when specified what kind of word is
search_analyzer word use which, but not at the time of storage, but what word is used when doing a query
ignore_above for more than ignore_above string, analyzer will not be processed; so we will not index it. The final result is that the search engines can not search. This option is mainly useful in field not_analyzed, these fields are generally used for filtering, aggregation and sorting. And these fields are structured, it is generally not allowed to index entries in these fields long.
format date format requirements, for example, set to "yyy-MM-dd HH:  mm: ss || yyyy-MM-dd || epoch_millis"

Guess you like

Origin www.cnblogs.com/devin-sl/p/12094268.html