Skip to content

Commit f352072

Browse files
authored
add signal based index updates (#60)
1 parent 4bcb264 commit f352072

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

docker/dev/config/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@
5656
'search',
5757
'url'
5858
)
59+

docker/dev/install_xapian.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
VERSION=1.4.20
2+
3+
# prepare
4+
mkdir $VIRTUAL_ENV/packages && cd $VIRTUAL_ENV/packages
5+
6+
CORE=xapian-core-$VERSION
7+
BINDINGS=xapian-bindings-$VERSION
8+
9+
# download
10+
echo "Downloading source..."
11+
curl -O https://oligarchy.co.uk/xapian/$VERSION/${CORE}.tar.xz
12+
curl -O https://oligarchy.co.uk/xapian/$VERSION/${BINDINGS}.tar.xz
13+
14+
# extract
15+
echo "Extracting source..."
16+
tar xf ${CORE}.tar.xz
17+
tar xf ${BINDINGS}.tar.xz
18+
19+
# install
20+
echo "Installing Xapian-core..."
21+
cd $VIRTUAL_ENV/packages/${CORE}
22+
./configure --prefix=$VIRTUAL_ENV && make && make install
23+
24+
PYV=`python -c "import sys;t='{v[0]}'.format(v=list(sys.version_info[:1]));sys.stdout.write(t)";`
25+
26+
if [ $PYV = "2" ]; then
27+
PYTHON_FLAG=--with-python
28+
else
29+
PYTHON_FLAG=--with-python3
30+
fi
31+
32+
echo "Installing Xapian-bindings..."
33+
cd $VIRTUAL_ENV/packages/${BINDINGS}
34+
./configure --prefix=$VIRTUAL_ENV $PYTHON_FLAG XAPIAN_CONFIG=$VIRTUAL_ENV/bin/xapian-config && make && make install
35+
36+
# clean
37+
# rm -rf $VIRTUAL_ENV/packages
38+
39+
# test
40+
python -c "import xapian"

papermerge/conf/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,3 +353,5 @@
353353
'ENGINE': SEARCH_ENGINES_MAP[search_engine],
354354
},
355355
}
356+
357+
HAYSTACK_SIGNAL_PROCESSOR = 'papermerge.search.signals.SignalProcessor'

papermerge/search/signals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from papermerge.core.models import DocumentVersion, Document, Folder
55

66

7-
class UserOnlySignalProcessor(signals.BaseSignalProcessor):
7+
class SignalProcessor(signals.BaseSignalProcessor):
88
def setup(self):
99
for klass in (DocumentVersion, Document, Folder):
1010
models.signals.post_save.connect(self.handle_save, sender=klass)

0 commit comments

Comments
 (0)