comparison CHANGES.txt @ 6915:9ff091537f43

postgresql native-fts; more indexer tests 1) Make postgresql native-fts actually work. 2) Add simple stopword filtering to sqlite native-fts indexer. 3) Add more tests for indexer_common get_indexer Details: 1) roundup/backends/indexer_postgresql_fts.py: ignore ValueError raised if we try to index a string with a null character in it. This could happen due to an incorrect text/ mime type on a file that has nulls in it. Replace ValueError raised by postgresql with customized IndexerQueryError if a search string has a null in it. roundup/backends/rdbms_common.py: Make postgresql native-fts work. When specified it was using using whatever was returned from get_indexer(). However loading the native-fts indexer backend failed because there was no connection to the postgresql database when this call was made. Simple solution, move the call after the open_connection call in Database::__init__(). However the open_connection call creates the schema for the database if it is not there. The schema builds tables for indexer=native type indexing. As part of the build it looks at the indexer to see the min/max size of the indexed tokens. No indexer define, we get a crash. So it's a a chicken/egg issue. I solved it by setting the indexer to the Indexer from indexer_common which has the min/max token size info. I also added a no-op save_indexer to this Indexer class. I claim save_indexer() isn't needed as a commit() on the db does all the saving required. Then after open_connection is called, I call get_indexer to retrieve the correct indexer and indexer_postgresql_fts woks since the conn connection property is defined. roundup/backends/indexer_common.py: add save_index() method for indexer. It does nothing but is needed in rdbms backends during schema initialization. 2) roundup/backends/indexer_sqlite_fts.py: when this indexer is used, the indexer test in DBTest on the word "the" fail. This is due to missing stopword filtering. Implement basic stopword filtering for bare stopwords (like 'the') to make the test pass. Note: this indexer is not currently automatically run by the CI suite, it was found during manual testing. However there is a FIXME to extract the indexer tests from DBTest and run it using this backend. roundup/configuration.py, roundup/doc/admin_guide.txt: update doc on stopword use for sqlite native-fts. test/db_test_base.py: DBTest::testStringBinary creates a file with nulls in it. It was breaking postgresql with native-fts indexer. Changed test to assign mime type application/octet-stream that prevents it from being processed by any text search indexer. add test to exclude indexer searching in specific props. This code path was untested before. test/test_indexer.py: add test to call find with no words. Untested code path. add test to index and find a string with a null \x00 byte. it was tested inadvertently by testStringBinary but this makes it explicit and moves it to indexer testing. (one version each for: generic, postgresql and mysql) Renamed Get_IndexerAutoSelectTest to Get_IndexerTest and renamed autoselect tests to include autoselect. Added tests for an invalid indexer and using native-fts with anydbm (unsupported combo) to make sure the code does something useful if the validation in configuration.py is broken. test/test_liveserver.py: add test to load an issue add test using text search (fts) to find the issue add tests to find issue using postgresql native-fts test/test_postgresql.py, test/test_sqlite.py: added explanation on how to setup integration test using native-fts. added code to clean up test environment if native-fts test is run.
author John Rouillard <rouilj@ieee.org>
date Mon, 05 Sep 2022 16:25:20 -0400
parents 3260926d7e7e
children a96a239db0d9
comparison
equal deleted inserted replaced
6914:6010c20dc104 6915:9ff091537f43
38 catching SSL.ZeroReturnError indicating SSL has been shut down. 38 catching SSL.ZeroReturnError indicating SSL has been shut down.
39 - add caching header for text/javascript in addition to depricated 39 - add caching header for text/javascript in addition to depricated
40 application/javascript. (John Rouillard) 40 application/javascript. (John Rouillard)
41 - Enable postgres-fts: fix indexer-common::get_indexer so it returns a 41 - Enable postgres-fts: fix indexer-common::get_indexer so it returns a
42 postgresql-fts Test code paths in get_indexer. (John Rouillard) 42 postgresql-fts Test code paths in get_indexer. (John Rouillard)
43 - Fix Postgres native-fts, implement a two phase initialization of the
44 indexer. The native-fts one gets assigned after the database
45 connection is open. (John Rouillard)
46 - fix crash if postgresql native-fts backend is asked to index content
47 with null bytes. (John Rouillard)
43 48
44 Features: 49 Features:
45 50
46 - Dockerfile build allows adding additional python packages via 51 - Dockerfile build allows adding additional python packages via
47 pip, setting UID tracker is run under. (John Rouillard) 52 pip, setting UID tracker is run under. (John Rouillard)
48 - issue2551140 - Added redis as a session and otk database for use 53 - issue2551140 - Added redis as a session and otk database for use
49 with anydbm and sqlite primary databases. (John Rouillard) 54 with anydbm and sqlite primary databases. (John Rouillard)
50 - issue2550559 - Pretty printing / formatting for Number types. 55 - issue2550559 - Pretty printing / formatting for Number types.
51 Added pretty(format='%0.3f') method to NumberHTMLProperty to 56 Added pretty(format='%0.3f') method to NumberHTMLProperty to
52 print numeric values. If value is None, return empty string 57 print numeric values. If value is None, return empty string
53 otherwise str() of value. 58 otherwise str() of value. (John Rouillard)
59 - sqlite native-fts backend now uses the stopwords list in config.ini
60 to filter words from queries. (Stopwords are still indexed so that
61 phrase/proximity searches still work.) (John Rouillard)
54 62
55 2022-07-13 2.2.0 63 2022-07-13 2.2.0
56 64
57 Fixed: 65 Fixed:
58 66

Roundup Issue Tracker: http://roundup-tracker.org/