文章詳情頁
java - Lucene 想刪除field 為指定值得數(shù)據(jù)
瀏覽:80日期:2023-10-18 18:19:52
問題描述
Document document = new Document();// 向Document對象中添加域信息// 參數(shù):1、域的名稱;2、域的值;3、是否存儲;Field contentField = new TextField('content', labelformat(t.getContent()), Store.YES);// storedFiled默認存儲Field tidField = new StoredField('tid', t.getTopicId());// 將域添加到document對象中document.add(contentField);document.add(tidField);// 將信息寫入到索引庫中indexWriter.addDocument(document);
我想刪除tid 為1的索引數(shù)據(jù),嘗試了下
indexWriter.deleteDocuments()
但是入?yún)⒅荒苁莙uery或者term對象,一直沒成功。請問下正確的應該如何做??
問題解答
回答1:百度到了解決方法,嘗試了下可以成功http://www.it610.com/article/...
標簽:
java
相關文章:
1. mysql - 新浪微博中的關注功能是如何設計表結(jié)構(gòu)的?2. angular.js - 關于$apply()3. MySQL數(shù)據(jù)庫中文亂碼的原因4. dockerfile - [docker build image失敗- npm install]5. angular.js使用$resource服務把數(shù)據(jù)存入mongodb的問題。6. 如何解決Centos下Docker服務啟動無響應,且輸入docker命令無響應?7. nignx - docker內(nèi)nginx 80端口被占用8. angular.js - Ionic 集成crosswalk后生成的apk在android4.4.2上安裝失?????9. android-studio - Android Studio 運行項目的時候一堆警告,跑步起來!?10. 我在centos容器里安裝docker,也就是在容器里安裝容器,報錯了?
排行榜

熱門標簽