同步操作将从 Hutool/elasticsearch-definitive-guide-cn 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
_source
fieldBy default, Elasticsearch stores the JSON string representing the
document body in the _source
field. Like all stored fields, the _source
field is compressed before being written to disk.
This is almost always desired functionality because it means that:
the full document is available directly from the search results — no need for a separate round trip to fetch the document from another datastore
partial update
requests will not function without the _source
field
when your mapping changes and you need to reindex your data, you can do so directly from Elasticsearch instead of having to retrieve all of your documents from another (usually slower) datastore
individual fields can be extracted from the _source
field and returned
in get
or search
requests when you don’t need to see the whole document
it is easier to debug queries because you can see exactly what each document contains, rather than having to guess their contents from a list of IDs
That said, storing the _source
field does use disk space. If none of the
above reasons is important to you, you can disable the _source
field with
the following mapping:
PUT /my_index
{
"mappings": {
"my_type": {
"_source": {
"enabled": false
}
}
}
}
In a search request, you can ask for only certain fields by specifying the
_source
parameter in the request body:
GET /_search
{
"query": { "match_all": {}},
"_source": [ "title", "created" ]
}
Values for these fields will be extracted from the _source
field and
returned instead of the full _source
.
Besides indexing the values of a field, you can also choose to store
the
original field value for later retrieval. Users with a Lucene background use
stored fields to choose which fields they would like to be able to return in
their search results. In fact the _source
field is a stored field.
In Elasticsearch, setting individual document fields to be stored is usually a
false optimization. The whole document is already stored as the _source
field. It is almost always better to just extract the fields that you need
using the _source
parameter.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。