Solr對資料庫中的CLOB欄位建立索引的問題
對於oracl中的clob欄位,solr建立索引時,如果沒有作處理,否則會展示成這樣。
<content>[email protected]</content>
需要在db-data-config.xml中加入如下紅色的部分:
transformer="ClobTransformer"
<field column="CONTENT" name="content" clob="true" />
<dataConfig> <dataSource type="JdbcDataSource" name="jdbc" driver="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@//*.*.*.*:port/orcl" user="root" password="root"/> <document> <entity name="item" transformer="ClobTransformer" query="select ID as id,NAME as name,PRICE as price, SUMMARY as summary,CONTENT as content from BOOK" <field column="CONTENT" name="content" clob="true" /> </entity> </document> </dataConfig>
這個field的column一定要寫成大寫的CONTENT,要不然轉換不了。
在schema.xml中新增需要檢索的field
<fields> <field name="id" type="string" indexed="true" stored="true" required="true" /> <field name="name" type="textMaxWord_cn" indexed="true" stored="true" /> <field name="price" type="long" indexed="true" stored="true" /> <field name="summary" type="textMaxWord_cn" indexed="true" stored="true" /> <field name="content" type="textMaxWord_cn" indexed="true" stored="true" /> <field name="searchText" type="textMaxWord_cn" indexed="true" stored="false" multiValued="true" /> </fields> <uniqueKey>id</uniqueKey> <defaultSearchField>searchText</defaultSearchField> <solrQueryParser defaultOperator="AND" /> <copyField source="name" dest="searchText" /> <copyField source="summary" dest="searchText" /> <copyField source="content" dest="searchText" />
相關推薦
Solr對資料庫中的CLOB欄位建立索引的問題
對於oracl中的clob欄位,solr建立索引時,如果沒有作處理,否則會展示成這樣。 <content>[email protected]</content> 需
Oracle資料庫中clob欄位轉成MD5碼,並能在where條件或者group中使用
轉載自:https://blog.csdn.net/siyouzi/article/details/29589613 1.建立java source ------------Java source------------------------ create or repl
資料庫中敏感欄位的標記、標示
資料治理需要面臨和解決的最重要的問題是,企業這麼多的資料庫,每個資料庫這麼多的表,每個表這麼多的欄位,如何進行資訊資產的分類分級。 通過以下方法,可以自動的取企業所有資料庫、所有表、所有欄位,根據欄位的值,利用正則表示式等方式判斷此欄位是否屬於使用者敏感資訊,如姓名、手機、地址、身份證等。 最終形成資料的
資料庫SQL實踐39:針對上面的salaries表emp_no欄位建立索引idx_emp_no
思路: SQLite中,使用 indexed by 語句進行強制索引查詢 select * from salaries indexed by idx_emp_no where emp_no=10005; MySQL中,使用 force index(indexname)語句進行強
資料庫中的欄位無法增刪改
前沿 進行機房重構有一段時間了,進行機房資料庫是必不可少的,我們在執行機房的同時也要把相應的資料存入資料庫,同樣,我們也需要資料庫裡的資料進行增刪改,可是我遇到了一個關於資料庫的問題... &nb
oracle資料庫中,欄位型別不一致,導致查詢慢
最近一個WEBSERVICE突然變慢了,後查詢發現,後臺查詢也非常慢(記錄條數800多萬),索引也有,如下語句 SELECT P.ID,P.RECORD_ID,P.KEY_NAME,P.KEY_CONTENT FROM MED_E
資料庫中時間欄位為null,獲取資料庫資料對映到類,類中相應的屬性的值是null還是時間預設值
由於最新需要判斷資料庫中時間是否符合邏輯資料來做後續業務處理,但是就是有點蒙,開始直接判斷是否為初始值,就是預設值,也就是 DateTime.MinValue,但是我想就是不對,
資料庫中的欄位NULL值和''
每次操作資料庫,都會遇到NULL和''的攔路虎,由於篩選條件模糊導致查詢結果錯誤。 String str1 = null; str引用為空 String str2 = ""; str引用一個空串nul
java 查詢資料庫中 某個欄位值是否已存在
String url = select count(*) from user where user_email = ?; PreparedStatement pstm = Connection|.preparedStatement (url); ResuleSet
sql server 統計資料庫中某個欄位的值,剔除重複資料和查詢重複的資料
1.有的時候,在資料庫中存在一些重複的資料,但是我們又想統計某個欄位的值,重複的要剔除掉,如圖所示: 在上面的圖我們可以看到,id=2,3 id=4,5的4條資料都重複了,我們統計amount只要其
oracle 資料庫中某個欄位逗號分隔,得到對應列中的個數(列轉行)實現方法
由於各種原因,資料的原則問題,導致某個欄位上出現多個數據(依據分隔符隔開),比如 name 欄位為 張三;李四;王五等等 需求:求一張表中name欄位中出現的個數; 想要得到的結果為: 對
MySQL資料庫中有欄位型別是日期、時間的插入語句的寫法處理
MySQL資料庫中,與時間有關的型別有 DATE,TIME,TIMESTAMP: 時間戳mysql> create table ts(f1 TIMESTAMP); Query OK, 0
批量修改oracle資料庫中sdo_geometry欄位的SRID
1,在user_sdo_geom_metadata表中插入或者修改需要修改表的名稱,表中的geometry欄位名稱和srid。具體可參考該表的欄位。 INSERT INTO USER_SDO_GEOM_METADATA (table_name,column_name,Dim
oracle資料庫檢視某張表已經存在的索引以及給某個欄位建立索引
檢視某張表已經存在的索引以及型別 SELECT b.uniqueness, a.index_name, a.table_name, a.column_name FROM all_ind_columns a, all_indexes b WHERE a.index_
關於資料庫中動態欄位的說明
可以用一個json資料來儲存 例如:將user類序列化來儲存到資料庫 User use = new User(); user.setId(“1”); user.setName(“123”);
SQL資料庫中各種欄位型別的說明
(1)char、varchar、text和nchar、nvarchar、ntext char和varchar的長度都在1到8000之間,它們的區別在於char是定長字元資料,而varchar是變長字元資料。所謂定長就是長度固定的,當輸入的資料長度沒有達到指定的長度時將自動以英文空格在其後面填充,使長度
mysql資料庫中某個欄位的資料為分號分割的資料,將該資料拆分成多行
SELECTcount(id) AS counts ,TITLE,CODE,chaifenFROM(SELECTt.CODE,t.TITLE,t.ID,substring_index(substring_index(t.CODE,';',b.help_topic_id + 1
Mybatis中的model實體與資料庫中的欄位不一致的解決方案
mybatis的強大之處一:resultMap 場景: model: package com.lgy.model; public class User { private Integer use
PHP 資料庫中某個欄位儲存的資料是陣列資料時,怎樣獲取並解析
當資料庫中某欄位儲存的資料是 陣列資料的時候 array ( 0 => array ( 'name' => 'xxx', '13fds' => '123123', 'dfsa' => '4444', 'fd
對列表中某些欄位進行動態校驗
//檢查明細四個合同金額是否與總合同金額相等 function checkEqualMoneys(flags){ var money = $("#projMoney").numberbox("getValue"); var result = add(add($("#deta