2018-8-25未命名文件

2018-8-25未命名文件

type(None) 16:35:39
elasticSearch解決大數據量字段模糊查詢,創建數據索引庫,全文檢索方式查詢。
全文檢索:檢索文本中的每一個詞與搜索項進行對此。
全文索引:採用分詞器,對文本每一個詞進行切分,創建詞條,方便進行查找。html

Lucene 就是一套 全文檢索編程API , 基於Lucene 對數據創建索引,進行查詢
如今企業開發中,更經常使用是的 solr 搜索服務器和 ElasticSearch 搜索服務器
1.索引對象: 存儲數據的表結構 ,任何搜索數據,存放在索引對象上
2.映射:數據如何存放到索引對象上,須要有一個映射配置, 數據類型、是否存儲、是否分詞
3.文檔: 一條數據記錄, 存在索引對象上
4.文檔類型: 一個索引對象 存放多種類型數據,數據用文檔類型進行標識redis

ElasticSearch有什麼優勢呢?
1 分佈式實時文件存儲,可將每個字段存入索引,使其能夠被檢索到。?
2 實時分析的分佈式搜索引擎。?
分佈式:索引分拆成多個分片,每一個分片可有零個或多個副本。集羣中的每一個數據節點均可承載一個或多個分片,而且協調和處理各類操做;?
負載再平衡和路由在大多數狀況下自動完成。?
3 能夠擴展到上百臺服務器,處理PB級別的結構化或非結構化數據。也能夠運行在單臺PC上(已測試)?
支持插件機制,分詞插件、同步插件、Hadoop插件、可視化插件等。sql

select * from students where name != "周杰倫";數據庫

select * from students where is_delete=0;編程

select * from students where id > 3 and gender = 0;緩存

select * from student where name like "黃%";服務器

select * from students where id between 3 and 8;微信

select * from students where height is null;併發

select * from students order by id desc;分佈式

select * from students where gender=1 order by id asc;

select * from students order by height desc, id asc;

select count(*) from students;

sel

select max(height) from students;

select sum(age) from students;

select avg(age) from students;

select sum(age) from students where gender = 1;

select avg(age) from students where gender = 1;

select sum(age)/count(*) from students;

select sum(age)/count(*) from students where gender = 1;

select gender from students group by gender;

select gender,group_concat(name) from students group by gender;

select gender,group_concat(name) from students group by gender;

select gender,avg(age) from students group by gender;

select gender,count(*) from students group by gender;

select gender,count() from students group by gender having count() > 2;

select gender,count(*) from students group by gender having gender = "男";

select gender,count(*) from students group by gender with rollup;

select gender,count(*),sum(age) from students group by gender with rollup;

select gender,group_concat(age) from students group by gender with rollup;

select * from students limit 0,4;

select * from students limit 2,2;

select * from students inner join classes on students.cls_id = classes.id;

select * from students inner join classes on students.cls_id = classes.id;

select * from students as s inner join classes as c on s.cls_id = c.id;

select * from students as s left join classes as c on s.cls_id = c.id;

select * from students as s right join classes c on s.cls_id = c.id;

select * from students order by id desc limt 0,2;

select * from students where age > (select avg(age) from students) ;

select * from students where age > (select avg(age) from students);

select * from classes where id in (select cls_id from students);

select * from students where (age,height) = (select max(age),max(height) from students);

select distinct gender from students;

select gender ,count(*) from students group by gender;

select gender,group_concat(name) from students group by gender;

select cls_id,group_concat(name) from students group by cls_id;

select * from students order by id desc;

select gender,count() from students group by gender having count() >2;

select gender,count(*) from students group by gender with rollup;

select * from students order by id desc limit 0,10;

select * from students inner join classes on students.cls_id = classes.id;

select students.name,classes.name from students inner join classes on students.cls_id = classes.id;

select students.name as a,classes.name as b from students inner join classes on students.cls_id = classes.id;

select * from students as s left join classes as c on s.cls_id = c.id;

select * from students as s right join classes as c on s.cls_id = c.id;

create table booktest_areainfo(
aid int primary key,
atitle varchar(20),
pid int
);

select count(*) from booktest_areainfo where pid is null;

select atitle from booktest_areainfo where pid is null;

select city.* from booktest_areainfo as city inner join booktest_areainfo as province on city.pid = province.aid where province.atitle="湖北省";

數據庫商品類表格的設計開發,

1,Django_Contab實現網站首頁靜態化頁面的定時更新; 2,Redis數據庫緩存高頻數據,加快網站的響應速度; 3,帳號(用戶名,電話號) + 密碼模式實現切換登陸,QQ,微信,微博等第三方登陸方式的引入,實現用戶多渠道登陸實現; 4,Celery搭配Admin站點類實現詳情頁面的後臺數據變更實時同步更新詳情靜態化頁面; 5,基於Cookie和Redis對傳統購物車的優化,未登陸用戶購物車數據暫存Cookies,登陸後同步數據到Redis中,提升用戶購物體驗; 6,訂單模塊的開發,Django中的Atomic來控制訂單模塊數據庫事務的執行,樂觀鎖防止高併發下的超賣現象; 7,Docker來部署FastDFS,重載Django原生的文件管理類,將FastDFS融入到項目中,實現海量文件的存儲; 8,sql數據庫雙機熱備,主從配置實現讀寫分離,提升數據庫性能; 9,Celery開啓進程訂閱redis數據過時信號,並相應的操做數據庫進行庫存的增長; 10,X-admin來搭建後臺站點管理,實現用戶權限管理;

相關文章
相關標籤/搜索