fix #214
This commit is contained in:
parent
bda72c02ea
commit
0a33fee7cf
7 changed files with 29 additions and 12 deletions
|
@ -257,10 +257,10 @@ public class SearchListAction implements Serializable {
|
|||
@Token(save = false, validate = true)
|
||||
@Execute(validator = true, input = "index")
|
||||
public String delete() {
|
||||
return deleteByQuery(searchListForm.id);
|
||||
return deleteByQuery(searchListForm.docId);
|
||||
}
|
||||
|
||||
private String deleteByQuery(final String deleteId) {
|
||||
private String deleteByQuery(final String docId) {
|
||||
if (jobHelper.isCrawlProcessRunning()) {
|
||||
throw new SSCActionMessagesException(
|
||||
"errors.failed_to_start_solr_process_because_of_running");
|
||||
|
@ -277,7 +277,8 @@ public class SearchListAction implements Serializable {
|
|||
if (!jobHelper.isCrawlProcessRunning()) {
|
||||
final long time = System.currentTimeMillis();
|
||||
try {
|
||||
solrGroup.deleteById(deleteId);
|
||||
solrGroup.deleteByQuery(fieldHelper.docIdField
|
||||
+ ":" + docId);
|
||||
solrGroup.optimize();
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("[EXEC TIME] index cleanup time: "
|
||||
|
@ -286,7 +287,8 @@ public class SearchListAction implements Serializable {
|
|||
}
|
||||
} catch (final Exception e) {
|
||||
logger.error("Failed to delete index (query="
|
||||
+ deleteId + ").", e);
|
||||
+ fieldHelper.docIdField + ":" + docId
|
||||
+ ").", e);
|
||||
}
|
||||
} else {
|
||||
if (logger.isInfoEnabled()) {
|
||||
|
|
|
@ -29,6 +29,7 @@ import jp.sf.fess.ds.DataStoreException;
|
|||
import jp.sf.fess.ds.IndexUpdateCallback;
|
||||
import jp.sf.fess.helper.CrawlingSessionHelper;
|
||||
import jp.sf.fess.helper.FieldHelper;
|
||||
import jp.sf.fess.helper.IndexingHelper;
|
||||
import jp.sf.fess.util.ComponentUtil;
|
||||
import jp.sf.orangesignal.csv.CsvConfig;
|
||||
|
||||
|
@ -273,7 +274,12 @@ public class FileListDataStoreImpl extends CsvDataStoreImpl {
|
|||
deleteIdList.add(crawlingSessionHelper.generateId(dataMap));
|
||||
|
||||
if (deleteIdList.size() >= maxDeleteDocumentCacheSize) {
|
||||
indexUpdateCallback.getSolrGroup().deleteById(deleteIdList);
|
||||
final IndexingHelper indexingHelper = ComponentUtil
|
||||
.getIndexingHelper();
|
||||
for (final String id : deleteIdList) {
|
||||
indexingHelper.deleteDocument(
|
||||
indexUpdateCallback.getSolrGroup(), id);
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Deleted " + deleteIdList);
|
||||
}
|
||||
|
@ -307,7 +313,12 @@ public class FileListDataStoreImpl extends CsvDataStoreImpl {
|
|||
@Override
|
||||
public void commit() {
|
||||
if (!deleteIdList.isEmpty()) {
|
||||
indexUpdateCallback.getSolrGroup().deleteById(deleteIdList);
|
||||
final IndexingHelper indexingHelper = ComponentUtil
|
||||
.getIndexingHelper();
|
||||
for (final String id : deleteIdList) {
|
||||
indexingHelper.deleteDocument(
|
||||
indexUpdateCallback.getSolrGroup(), id);
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Deleted " + deleteIdList);
|
||||
}
|
||||
|
|
|
@ -39,5 +39,9 @@ public class SearchListForm implements Serializable {
|
|||
public String num;
|
||||
|
||||
@Required(target = "confirmDelete,delete")
|
||||
public String id;
|
||||
public String docId;
|
||||
|
||||
@Required(target = "confirmDelete")
|
||||
public String url;
|
||||
|
||||
}
|
||||
|
|
|
@ -1058,7 +1058,7 @@ labels.search_list_index_page=Type a search query.
|
|||
|
||||
# view/admin/searchList/confirmDelete.jsp
|
||||
labels.search_list_title_confirm_delete=Delete Confirmation
|
||||
labels.search_list_id=ID
|
||||
labels.search_list_url=URL
|
||||
labels.search_list_delete_link=Delete
|
||||
|
||||
# view/admin/searchLog/index.jsp
|
||||
|
|
|
@ -1058,7 +1058,7 @@ labels.search_list_index_page=\u691c\u7d22\u30af\u30a8\u30ea\u30fc\u3092\u5165\u
|
|||
|
||||
# view/admin/searchList/confirmDelete.jsp
|
||||
labels.search_list_title_confirm_delete=\u524a\u9664\u306e\u78ba\u8a8d
|
||||
labels.search_list_id=ID
|
||||
labels.search_list_url=URL
|
||||
labels.search_list_delete_link=\u524a\u9664
|
||||
|
||||
# view/admin/searchLog/index.jsp
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
<tr>
|
||||
<th style="width: 100px;"><bean:message
|
||||
key="labels.search_list_id" /></th>
|
||||
<td style="width: 400px;">${f:h(id)}<html:hidden
|
||||
property="id" /></td>
|
||||
<td style="width: 400px;">${f:h(url)}<html:hidden
|
||||
property="docId" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
<div style="text-align: right;">
|
||||
<c:if test="${!solrProcessRunning}">
|
||||
<html:link
|
||||
href="confirmDelete?query=${f:u(query)}&id=${f:u(doc.id)}">
|
||||
href="confirmDelete?query=${f:u(query)}&docId=${f:u(doc.docId)}&url=${f:u(doc.url)}">
|
||||
<bean:message key="labels.search_list_delete_link" />
|
||||
</html:link>
|
||||
</c:if>
|
||||
|
|
Loading…
Add table
Reference in a new issue