第三百六十四節,Python分布式爬蟲打造搜尋引擎Scrapy精講—elasticsearch(搜尋引擎)的mapping映射管理

來源:互聯網
上載者:User

標籤:一個   string   format   clu   bsp   ast   for   建立   ted   

第三百六十四節,Python分布式爬蟲打造搜尋引擎Scrapy精講—elasticsearch(搜尋引擎)的mapping映射管理

 

1、映射(mapping)介紹

映射:建立索引的時候,可以預先定義欄位的類型以及相關屬性
elasticsearch會根據json來源資料的基礎類型猜測你想要的欄位對應,將輸入的資料轉換成可搜尋的索引項目,mapping就是我們自己定義的欄位資料類型,同時告訴elasticsearch如何索引資料以及是否可以被搜尋


作用:會讓索引建立的更加細緻和完善


類型:靜態映射和動態映射

 

 

2、內建映射類型(也就是資料類型)

string類型:text,keyword兩種
  text類型:會進行分詞,抽取詞幹,建立倒排索引
  keyword類型:就是一個一般字元串,只能完全符合才能搜尋到

數字類型:long,integer,short,byte,double,float

日期類型:date

bool(布爾)類型:boolean

binary(二進位)類型:binary

複雜類型:object,nested

geo(地區)類型:geo-point,geo-shape

專業類型:ip,competion

 

 

3、屬性介紹
store屬性
index屬性
null_value屬性
analyzer屬性
include_in_all屬性
format屬性

 

 

 

 

 

第三百六十四節,Python分布式爬蟲打造搜尋引擎Scrapy精講—elasticsearch(搜尋引擎)的mapping映射管理

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.