mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-15 06:01:19 +00:00
save folder id as path (not fully working)
This commit is contained in:
parent
13fbd10d45
commit
90b3298b60
|
@ -128,7 +128,10 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document {
|
||||||
if($comment = $document->getComment()) {
|
if($comment = $document->getComment()) {
|
||||||
$this->addField(Zend_Search_Lucene_Field::Text('comment', $comment, 'utf-8'));
|
$this->addField(Zend_Search_Lucene_Field::Text('comment', $comment, 'utf-8'));
|
||||||
}
|
}
|
||||||
$this->addField(Zend_Search_Lucene_Field::Keyword('path', $document->getFolderList()));
|
$tmp = explode(':', substr($document->getFolderList(), 1, -1));
|
||||||
|
foreach($tmp as $t)
|
||||||
|
$this->addField(Zend_Search_Lucene_Field::Keyword('path', $t));
|
||||||
|
// $this->addField(Zend_Search_Lucene_Field::Keyword('path', str_replace(':', 'x', $document->getFolderList())));
|
||||||
|
|
||||||
if($document->isType('document')) {
|
if($document->isType('document')) {
|
||||||
$this->addField(Zend_Search_Lucene_Field::Keyword('document_id', 'D'.$document->getID()));
|
$this->addField(Zend_Search_Lucene_Field::Keyword('document_id', 'D'.$document->getID()));
|
||||||
|
|
|
@ -114,17 +114,22 @@ class SeedDMS_Lucene_Search {
|
||||||
if($querystr)
|
if($querystr)
|
||||||
$querystr .= ' && ';
|
$querystr .= ' && ';
|
||||||
$querystr .= '(path:"';
|
$querystr .= '(path:"';
|
||||||
$querystr .= $fields['rootFolder']->getFolderList().$fields['rootFolder']->getID().':';
|
$tmp[] = $fields['rootFolder']->getID();
|
||||||
|
$querystr .= implode('" && path:"', $tmp);
|
||||||
|
//$querystr .= $fields['rootFolder']->getFolderList().$fields['rootFolder']->getID().':';
|
||||||
$querystr .= '")';
|
$querystr .= '")';
|
||||||
}
|
}
|
||||||
if(!empty($fields['startFolder']) && $fields['startFolder']->getFolderList()) {
|
if(!empty($fields['startFolder']) && $fields['startFolder']->getFolderList()) {
|
||||||
if($querystr)
|
if($querystr)
|
||||||
$querystr .= ' && ';
|
$querystr .= ' && ';
|
||||||
$querystr .= '(path:"';
|
$querystr .= '(path:"';
|
||||||
$querystr .= $fields['startFolder']->getFolderList().$fields['startFolder']->getID().':';
|
// $querystr .= str_replace(':', 'x', $fields['startFolder']->getFolderList().$fields['startFolder']->getID().':');
|
||||||
|
$tmp = array();//explode(':', substr($fields['startFolder']->getFolderList(), 1, -1));
|
||||||
|
$tmp[] = $fields['startFolder']->getID();
|
||||||
|
$querystr .= implode('" && path:"', $tmp);
|
||||||
|
// $querystr .= str_replace(':', ' ', $fields['startFolder']->getFolderList().$fields['startFolder']->getID());
|
||||||
$querystr .= '")';
|
$querystr .= '")';
|
||||||
}
|
}
|
||||||
echo $querystr;
|
|
||||||
try {
|
try {
|
||||||
$query = Zend_Search_Lucene_Search_QueryParser::parse($querystr);
|
$query = Zend_Search_Lucene_Search_QueryParser::parse($querystr);
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user